PMM-15249 ethtool name collision. - #1330
Open
JiriCtvrtka wants to merge 14 commits into
Open
Conversation
Contributor
Author
|
@copilot review |
JiriCtvrtka
force-pushed
the
PMM-15249-ethtool-name-collision
branch
from
July 27, 2026 09:49
feab3ec to
35abe00
Compare
Contributor
Author
|
@copilot review |
Contributor
Author
|
@copilot review |
JiriCtvrtka
marked this pull request as ready for review
August 4, 2026 06:39
JiriCtvrtka
requested review from
ademidoff and
maxkondr
and removed request for
a team
August 4, 2026 06:39
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.
PMM-15249
Problem
On MongoDB 8.3 the
getDiagnosticDatareply containssystemMetrics.ethtoolcounters whose namesdiffer only in characters that
prometheusizecollapses. A vmxnet3 NIC, for example, reports both" giant hdr"and" giant hdr", and both map tomongodb_sys_ethtool_ens192_giant_hdrwith a different help string.The registry then rejects the scrape with
collected metric ... was collected before with the same name and label values, so the wholesystemMetricstree is lost, not just the offending counters.Solution
Colliding fields of one document are now exported under a single canonical metric name, and the new
metric_fieldlabel carries the document field each series was built from:prometheusizeitself, because anything less misses cases — fieldsdiffering only in a trailing special character or in a run of underscores share a name too.
decoded into a map, so the name has to be derived deterministically to stay stable between
scrapes (and not to renumber when MongoDB stops reporting one of the fields).
metric family.
nodeToPDMetrics) are skipped: their keysnever reach the metric name, and labelling only a part of such a family would make the descriptor
inconsistent.
isUnambiguousKeypre-check keeps the collision scan off the hot path — almost everythingMongoDB reports passes through
prometheusizeunchanged.Metrics with a unique name are unaffected and do not get the extra label.
Tests
testdata/get_diagnostic_data_8.3.json— a reply captured from the MongoDB 8.3.2 instance fromCollected Metric was collected before with the same name and label values with MongoDB 8.3.1 #1285, trimmed to the relevant subtrees. It is parsed as extended JSON, otherwise arrays decode
to
[]anyandmakeMetricssilently walks past everything array shaped (histogram bucketsincluded).
descriptors fail the test instead of the scrape.
collidingFieldsandisUnambiguousKeycover whitespace, other specialcharacters, underscore runs and leading/trailing underscores.