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.
The DSX exchange consumer's message counters are exposed with a doubled suffix --
carbide_dsx_exchange_consumer_messages_received_total_totaland its three siblings -- because the instruments were registered with a name already ending in_totaland the Prometheus exporter appends another_totalunconditionally. This is the classic "don't put_totalin the OpenTelemetry instrument name" footgun. This de-doubles them to the intended single-_totalnames.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_totalfrom 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 foralerts_detectedif it hasn't been converted by then...._total_totalseries. Coordinate the cutover.tests/metric_exposition.rsto assert the new single-_totalnames.Notably, the framework's name validator does not currently catch this class of mistake -- a doubled
..._total_totalname passes both thecarbide_prefix and the_totalsuffix checks. A cheap guard (reject a counter name that still ends in_totalafter the framework's own_totalstrip) would prevent a repeat; that hardening fits the derive-enforcement work under #3180.Part of #3169.