Skip to content

De-double the dsx-exchange-consumer counter metric names #3431

Description

@chet

The DSX exchange consumer's message counters are exposed with a doubled suffix -- carbide_dsx_exchange_consumer_messages_received_total_total and its three siblings -- because the instruments were registered with a name already ending in _total and the Prometheus exporter appends another _total unconditionally. This is the classic "don't put _total in the OpenTelemetry instrument name" footgun. This de-doubles them to the intended single-_total names.

The reshape in #3427 deliberately preserved the doubled names byte-for-byte (via name_unchecked) so it could stay a zero-observable-change refactor off the metric-review gate; fixing the name is a separate, deliberate change and belongs here.

What this involves

  • crates/dsx-exchange-consumer/src/metrics.rs: drop the trailing _total from each event's declared name so the exporter's append produces a single _total (carbide_dsx_exchange_consumer_messages_received_total, _processed_total, _dropped_total, dedup_skipped_total). Do the same for alerts_detected if it hasn't been converted by then.
  • This is an exposed-metric rename: it needs a tech-writer pass on the descriptions and a migration of any dashboard or alert selecting the old ..._total_total series. Coordinate the cutover.
  • Update the pinning test in tests/metric_exposition.rs to assert the new single-_total names.

Notably, the framework's name validator does not currently catch this class of mistake -- a doubled ..._total_total name passes both the carbide_ prefix and the _total suffix checks. A cheap guard (reject a counter name that still ends in _total after the framework's own _total strip) would prevent a repeat; that hardening fits the derive-enforcement work under #3180.

Part of #3169.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Fields

No fields configured for Task.

Projects

Status
Verify

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions