Skip to content

Conversation

@patrick-ogrady
Copy link
Contributor

Related: #2570

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 4, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
commonware-mcp a2d2d46 Jan 04 2026, 08:33 PM

@patrick-ogrady patrick-ogrady force-pushed the patrick/improve-logging-metrics-listener branch from e42c969 to ab9e1e8 Compare January 4, 2026 20:18
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 4, 2026

Deploying monorepo with  Cloudflare Pages  Cloudflare Pages

Latest commit: a2d2d46
Status: ✅  Deploy successful!
Preview URL: https://10e0a6d5.monorepo-eu0.pages.dev
Branch Preview URL: https://patrick-improve-logging-metr.monorepo-eu0.pages.dev

View logs

Add an `Attempt` enum to provide specific rejection reasons when
refusing incoming connections. Previously, both lookup and discovery
listeners used generic metrics/logging that didn't distinguish between
different rejection causes, making debugging difficult.

The `Attempt` enum has variants for: Ok, Blocked, Unregistered,
Reserved (already connected), Mismatch (e.g., IP doesn't match),
and Myself (trying to connect to ourselves).

Changes:
- Add shared `Attempt` enum in `authenticated/mod.rs`
- Update record `acceptable()` methods to return `Attempt`
- Update directory `acceptable()` to check blocked status and
  increment specific metrics (rejected_blocked, rejected_unregistered,
  rejected_reserved, rejected_mismatch, rejected_myself)
- Update listeners to convert `Attempt` to bool for stream crate
- Add `ListenableIps` struct with `allowed` and `blocked` sets to
  enable proper IP-level metrics in lookup listener
- Add `handshakes_ip_blocked` metric for blocked peer IPs (pre-handshake)
- Add `handshakes_ip_unregistered` metric for unregistered IPs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@patrick-ogrady patrick-ogrady force-pushed the patrick/improve-logging-metrics-listener branch from ab9e1e8 to a2d2d46 Compare January 4, 2026 20:33
@codecov
Copy link

codecov bot commented Jan 4, 2026

Codecov Report

❌ Patch coverage is 88.72180% with 30 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.78%. Comparing base (45b0c9a) to head (a2d2d46).

Files with missing lines Patch % Lines
...c/authenticated/lookup/actors/tracker/directory.rs 80.00% 19 Missing ⚠️
p2p/src/authenticated/lookup/actors/listener.rs 82.35% 6 Missing ⚠️
p2p/src/authenticated/discovery/actors/listener.rs 60.00% 2 Missing ⚠️
...uthenticated/discovery/actors/tracker/directory.rs 92.30% 2 Missing ⚠️
...c/authenticated/discovery/actors/tracker/record.rs 90.90% 1 Missing ⚠️
@@           Coverage Diff            @@
##             main    #2686    +/-   ##
========================================
  Coverage   92.77%   92.78%            
========================================
  Files         362      362            
  Lines      106074   106203   +129     
========================================
+ Hits        98412    98537   +125     
- Misses       7662     7666     +4     
Files with missing lines Coverage Δ
...rc/authenticated/discovery/actors/tracker/actor.rs 95.48% <100.00%> (+0.01%) ⬆️
.../authenticated/discovery/actors/tracker/ingress.rs 88.23% <100.00%> (ø)
.../authenticated/discovery/actors/tracker/metrics.rs 100.00% <100.00%> (ø)
...p/src/authenticated/lookup/actors/tracker/actor.rs 94.45% <100.00%> (+0.11%) ⬆️
...src/authenticated/lookup/actors/tracker/ingress.rs 85.71% <100.00%> (ø)
...src/authenticated/lookup/actors/tracker/metrics.rs 100.00% <100.00%> (ø)
.../src/authenticated/lookup/actors/tracker/record.rs 97.78% <100.00%> (+3.35%) ⬆️
p2p/src/authenticated/lookup/network.rs 91.37% <100.00%> (ø)
...c/authenticated/discovery/actors/tracker/record.rs 96.66% <90.90%> (-0.14%) ⬇️
p2p/src/authenticated/discovery/actors/listener.rs 89.45% <60.00%> (+0.07%) ⬆️
... and 3 more

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 45b0c9a...a2d2d46. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants