Skip to content

chore: downgrade per-message log to trace#45

Merged
Fraser999 merged 3 commits into
mainfrom
fraser/eng-2158/reduce-log-level
Apr 17, 2026
Merged

chore: downgrade per-message log to trace#45
Fraser999 merged 3 commits into
mainfrom
fraser/eng-2158/reduce-log-level

Conversation

@Fraser999

@Fraser999 Fraser999 commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes ENG-2158. The ajj::axum rpc.message event was emitted at info! for every inbound and outbound message, producing ~1.69M info logs/hr on signet-sidecar mainnet. Every entry was the same shape: an id, RECEIVED/SENT, and an uncompressed byte size.

This PR:

  • Demotes message_event! from info! to trace!. Per-message events are high-frequency and belong behind trace, not debug (anyone enabling debug on ajj for unrelated diagnostics would otherwise be flooded). OTel semantic conventions describe the span-event, they don't mandate a log level.
  • Adds an ajj.router.message_size_bytes histogram so operators don't lose size visibility. Labels: service, direction (RECEIVED/SENT), matching the existing ajj.router.* metric family which already tags by service.
  • Threads service through the message_event! macro. RouteTask already had router in scope; WriteTask gained a service_name: &'static str field populated from the router at ConnectionManager::make_tasks.
  • Updates the CODEOWNERS file in line with other repos.

Versioning

0.7.0 -> 0.7.1 (patch). No API changes. The log-level demotion is a behaviour change but not a breaking interface change, and the histogram is additive.

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@Fraser999 Fraser999 changed the title downgrade per-message log to trace and add message-size histogram chore: downgrade per-message log to trace Apr 17, 2026
@Fraser999 Fraser999 force-pushed the fraser/eng-2158/reduce-log-level branch from d3560f0 to 8d4841a Compare April 17, 2026 12:01
Comment thread src/metrics.rs

@Evalir Evalir left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no nits otherwise

@Fraser999 Fraser999 enabled auto-merge (squash) April 17, 2026 22:03
@Fraser999 Fraser999 merged commit 400e121 into main Apr 17, 2026
8 checks passed
@Fraser999 Fraser999 deleted the fraser/eng-2158/reduce-log-level branch April 17, 2026 22:05
prestwich added a commit that referenced this pull request Apr 22, 2026
…service_name` (#46)

* refactor(routes): expose TracingInfo::request_span to crate

* refactor: store TracingInfo in Arc on HandlerCtx

HandlerCtx.tracing becomes Arc<TracingInfo> so the same tracing state
can be shared with WriteItems without repeated cloning. HandlerCtx::new
callers (axum and pubsub) now pass Arc<TracingInfo>.

HandlerCtx::tracing_info, HandlerCtx::service_name, and
HandlerArgs::service_name lose their `const` qualifier because Arc
deref is not `const` on stable.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* refactor(pubsub): carry Arc<TracingInfo> on WriteItem

WriteItem, NotifyPermit, and OwnedNotifyPermit now carry
Arc<TracingInfo> in place of tracing::Span. WriteTask::task_future
reads the service label and request span off the shared TracingInfo,
so the service_name field threaded through in #45 is no longer needed
and has been removed from WriteTask.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix: make --no-default-features build clean

Relocate WriteItem from src/pubsub/shared.rs (pubsub-gated) to
src/routes/ctx.rs so it is visible without the pubsub feature, and
gate the two notification methods that depend on tokio_stream
(HandlerCtx::notify_stream, HandlerCtx::spawn_notify_stream) behind
#[cfg(feature = "pubsub")]. The other notification APIs (notify,
permit*) remain unconditional; without pubsub they are harmless
no-ops.

Additional #[cfg] gates to silence dead-code / unused-import lints
exposed now that the lib actually compiles without features:

- message_event! macro + record_message_size + message_size behind
  any(axum, pubsub)
- metrics::{histogram, Histogram} imports behind any(axum, pubsub)
- HandlerCtx::new gets allow(dead_code) when both axum and pubsub
  are off (nothing can construct a HandlerCtx)
- WriteItem struct gets allow(dead_code) without pubsub (no reader)

Replace two intra-doc links whose targets are feature-gated
(pubsub::AxumWsCfg, pubsub::ajj_websocket in lib.rs; axum in
handler.rs) with inline code so rustdoc --no-default-features no
longer fails link resolution.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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