Repository navigation
fix(obs): awsemf was billing nine series where the registry declares four - #615
Merged
Merged
Conversation
…four
The one calculation the metric registry exists to keep honest was wrong, in
the direction of understating cost.
`er.db.query.duration` declares two dimensions, `db.system.name` x `outcome`,
and `registry.rs` states four series. Measured in ER/Dev on 2026-11-05 it had
become four dimension SETS:
db.system.name, OTelLib, outcome -> 2 x 2 = 4 series
OTelLib, outcome -> 2
OTelLib -> 1
db.system.name, OTelLib -> 2
Nine billable CloudWatch custom metrics, not four. By default awsemf rolls
dimensions up — one series per SUBSET of the dimensions — and injects
`OTelLib` as a dimension of its own. A small absolute number and a 2.25x
error in exactly the arithmetic P12 used to justify keeping `statement_name`
off the metric.
`dimension_rollup_option: NoDimensionRollup` makes the bill equal the
declaration, and is where the exporter is going anyway: it logs "the default
value for DimensionRollupOption will be changing to NoDimensionRollup in a
future release" on every start. That line was in the log the whole time —
visible while I was diagnosing something else, skimmed as a deprecation
notice, and it was the answer.
`registry.rs` now says that `series` is the OTel-side cardinality and equals
the CloudWatch bill ONLY while that exporter setting holds. Worth stating
because `tests/cardinality.rs` cannot check it: the inflation happens in the
collector, after the process that declared the number. That is the one part of
this calculation a Rust test cannot hold, so it is written down instead.
Found by asking what the four series in ER/Dev actually WERE rather than
taking a count of four as agreement with a declaration of four. The count
matched; nothing else did.
make check exit 0.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This was referenced Nov 6, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The one calculation the metric registry exists to keep honest was wrong — in
the direction of understating cost.
Measured, not reasoned
er.db.query.durationdeclares two dimensions andregistry.rsstates 4series. In ER/Dev on 2026-11-05 it had become four dimension sets:
db.system.name, OTelLib, outcomeOTelLib, outcomeOTelLibdb.system.name, OTelLibBy default
awsemfrolls dimensions up — one series per subset — andinjects
OTelLibas a dimension of its own. Nine billable CloudWatch custommetrics, not four: a small absolute number, and a 2.25× error in exactly the
arithmetic P12 used to justify keeping
statement_nameoff the metric.The fix
dimension_rollup_option: NoDimensionRollupmakes the bill equal thedeclaration. It is also where the exporter is going anyway — it logs
on every start. That line was in the log the whole time: I saw it while
diagnosing something else, read it as a deprecation notice, and moved on. It
was the answer.
What the registry now says
seriesis the OTel-side cardinality, and equals the CloudWatch bill onlywhile that exporter setting holds.
Worth writing down because
tests/cardinality.rscannot check it: theinflation happens in the collector, after the process that declared the number.
That is the one part of this calculation a Rust test cannot hold.
How it was found
By asking what the four series in ER/Dev actually were, rather than taking a
count of four as agreement with a declaration of four. The count matched;
nothing else did.
make check→ exit 0.🤖 Generated with Claude Code