Skip to content

Add outbox metrics - #4484

Merged
iancooper merged 8 commits into
BrighterCommand:masterfrom
taharafique:outbox-metrics
Oct 12, 2026
Merged

iancooper merged 8 commits into
BrighterCommand:masterfrom
taharafique:outbox-metrics

Conversation

@taharafique

@taharafique taharafique commented Sep 30, 2026 •

Copy link
Copy Markdown

Summary

Requirements and ADR for OpenTelemetry metrics on the Outbox (spec 0037). Docs only, no code changes yet.

Today the Outbox's only signal is trace spans. The add path often has a null span and production sampling drops the rest, so we have no aggregate view of Outbox volume or lag.

Proposal (ADR 0072)

OutboxProducerMediator records to three instruments directly, behind a new IAmABrighterOutboxMeter. Nothing is derived from traces, so metrics record even when tracing is off or unsampled.

Instrument Type Attributes
paramore.brighter.outbox.added.messages Counter<long> messaging.destination.name
paramore.brighter.outbox.cleared.messages Counter<long> + paramore.brighter.outbox.clear_source (explicit / sweeper / unknown)
paramore.brighter.outbox.publish.duration Histogram<double> (s) same as cleared
  • Clear source is passed down to the private dispatch methods as an OutboxClearSource parameter.
  • For publish-confirmation producers, creation time is held in a bounded, TTL-evicted pending-clear map until the broker confirms.
  • No public API break, no changes to Outbox implementations, no schema change.

Open questions for maintainers

  • .duration vs .latency for the histogram name
  • Counter<long> vs Counter<int>, to match MessagingMeter

Files

  • specs/0037-outbox-metrics/requirements.md
  • docs/adr/0072-outbox-metrics.md

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


taha-rafique seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@iancooper

Copy link
Copy Markdown
Member

Thanks for this @taharafique It looks good to me, go ahead

@iancooper
iancooper marked this pull request as draft October 1, 2026 11:21
@iancooper iancooper added 2 - In Progress .NET Pull requests that update .net code Draft This is a work in progress V10.X labels Oct 1, 2026

@iancooper iancooper 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.

@taharafique My main question is whether I always need an OutboxMeter. Typically, we would make this optional, so passing null means you have no meter and can return quickly from any meter-recording calls.

Typically, we would configure this as part of our setup of Telemetry and meters; see: src/Paramore.Brighter.Extensions.OpenTelemetry/OpenTelemetryBuilderExtensions.cs, and that ought to be where we enable it

This would also mean that you don't need to include it in BuildOutBoxProducerMediator because you would built it as part of the set up of our telemetry.

@iancooper iancooper 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.

Thanks @taharafique

@iancooper

Copy link
Copy Markdown
Member

Thanks @taharafique

@iancooper
iancooper merged commit f955333 into BrighterCommand:master Oct 12, 2026
33 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2 - In Progress Draft This is a work in progress .NET Pull requests that update .net code V10.X

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants