Skip to content

Distributed Private Diagnostics JSON#114

Open
patrickleet wants to merge 1 commit into
mainfrom
tasks--distributed-private-diagnostics-json-1
Open

Distributed Private Diagnostics JSON#114
patrickleet wants to merge 1 commit into
mainfrom
tasks--distributed-private-diagnostics-json-1

Conversation

@patrickleet

Copy link
Copy Markdown
Collaborator

Summary

  • Adds a schema-versioned private diagnostics JSON snapshot with service inventory, health/readiness, telemetry capabilities, outbox backlog, recent failures, causal hints, suggested actions, partial/truncation metadata, and short TTL caching.
  • Adds a bounded sanitized recent-failure ring buffer and records microsvc dispatch, transport runner, and outbox publish failures without payloads, session variables, auth headers, cookies, raw metadata, env vars, DB URLs, or secrets.
  • Adds explicit opt-in HTTP composition via microsvc::router_with_diagnostics(...), access-check/bearer-token hooks, and Cache-Control: no-store responses.
  • Documents the private reconnaissance-grade posture and adds diagnostics integration tests.

Acceptance criteria addressed

  • Diagnostics route is absent unless explicitly composed.
  • Configured diagnostics access hook returns 401 for unauthorized requests.
  • Snapshot includes schema version, generated timestamp, age, partial/truncated markers, service inventory, telemetry, health/readiness, backlog summaries, recent failures, causal hints, and suggested actions.
  • Recent failures are bounded with capacity, dropped count, omitted count, and eviction tests.
  • Command/event and recent-failure lists are capped with truncation metadata.
  • Integration test drives successful dispatch, unknown command, transport failure, and outbox backlog, then checks diagnostics against metrics/backlog state.
  • Privacy tests assert payloads, decoded inputs, session values, auth headers, cookies, raw metadata, DB URLs, env values, and secrets are absent.
  • Snapshot/cache tests cover TTL, generated_at, age_ms, partial errors, truncation, and bounded response size.
  • Docs state diagnostics are private and must not use /metrics unauthenticated exposure semantics.

Verification

  • cargo fmt --check
  • git diff --check
  • cargo check
  • cargo check --features http,metrics
  • cargo test
  • cargo test --features http,metrics

Implements [[tasks/distributed-private-diagnostics-json-1]]
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@patrickleet, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 15 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 83b12303-7f88-42d8-8f49-7c2937f34d1a

📥 Commits

Reviewing files that changed from the base of the PR and between 84a72f1 and 957937e.

📒 Files selected for processing (14)
  • Cargo.toml
  • docs/diagnostics.md
  • docs/metrics.md
  • docs/observability.md
  • src/bus/runner.rs
  • src/diagnostics.rs
  • src/lib.rs
  • src/microsvc/http.rs
  • src/microsvc/mod.rs
  • src/microsvc/service.rs
  • src/outbox_worker/mod.rs
  • src/outbox_worker/outbox_dispatch.rs
  • src/outbox_worker/publish_hook.rs
  • tests/diagnostics/main.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch tasks--distributed-private-diagnostics-json-1

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant