generated from dailydevops/template-dotnet
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
type:featureIndicates a new feature or enhancement to be added.Indicates a new feature or enhancement to be added.
Description
User Story
As a platform engineer operating the outbox processor, I want detailed metrics for the outbox pipeline exposed via System.Diagnostics.Metrics, so that I can monitor queue depth, failure rates, and processing latency in production using OpenTelemetry-compatible tooling.
Background
The current ActivityAndMetricsRequestInterceptor covers mediator-level metrics (pulse.requests.total, pulse.request.duration, etc.), but the outbox processor background service emits no metrics. This creates a blind spot for operations teams monitoring message delivery health.
Requirements
- Extend the existing
Meter("NetEvolve.Pulse") inDefaults.cswith the following new instruments:Metric Name Instrument Type Unit Description pulse.outbox.pendingObservableGauge<long>messages Current number of pending outbox messages pulse.outbox.processed.totalCounter<long>messages Cumulative number of successfully processed messages pulse.outbox.failed.totalCounter<long>messages Cumulative number of failed processing attempts pulse.outbox.deadletter.totalCounter<long>messages Cumulative number of messages moved to dead-letter pulse.outbox.processing.durationHistogram<double>ms Duration of each outbox processing batch OutboxProcessorHostedServicemust record all metrics during its polling loop.- The
pulse.outbox.pendinggauge must query theIOutboxRepositoryfor the current count. - Metric recording must not throw; exceptions must be caught and logged at
Warninglevel.
Acceptance Criteria
- All five metrics are registered and visible when the outbox processor is configured.
-
pulse.outbox.pendingreflects the actual value returned byIOutboxRepository. -
pulse.outbox.processed.totalincrements by the number of messages successfully sent in a batch. -
pulse.outbox.failed.totalincrements when a message transitions toFailed. -
pulse.outbox.deadletter.totalincrements when a message transitions toDeadLetter. -
pulse.outbox.processing.durationrecords the elapsed time per polling cycle as a histogram. - Unit tests verify metric instrument registration and correct increment/observation behavior.
- Integration tests verify that metrics are non-zero after a processing cycle with messages.
- XML documentation is updated for any modified public or internal members.
Out of Scope
- Custom OpenTelemetry exporters.
- Dashboard or alerting configuration.
- Per-event-type metric dimensions/tags (may be addressed in a follow-up).
Reactions are currently unavailable
Metadata
Metadata
Labels
type:featureIndicates a new feature or enhancement to be added.Indicates a new feature or enhancement to be added.