Repository navigation
Conversation
yew1eb
force-pushed
the
fix/metrics-histogram-label-keys
branch
from
October 28, 2026 12:52
68496be to
b026047
Compare
…g missed in metrics count
1. `AbstractSource.addHistogram` computes the label-aware key `metricNameWithLabel` but
registers the Dropwizard histogram under the bare `name`, so every labeled variant of the
same histogram shares a single reservoir. It now registers under `metricNameWithLabel`,
consistent with `addTimer`, `addCounter` and `addGauge`.
2. `AbstractSource.getAllMetricsNum` now includes `namedHistogram.size()`, so the metrics
capacity warning counts what `getMetrics` actually emits.
- With the old code, adding a label (e.g. a disk label on `PartitionFileSize`) makes all
labeled variants read the same aggregated reservoir, so they report identical
`Count`/`Max`/percentiles. It is latent today because the only two histograms
(`FetchChunkTransferSize`, `PartitionFileSize`) carry no labels yet. Registering under the
labeled key also keeps a future `removeHistogram(name, labels)` consistent with the other
metric types, which remove by the labeled key.
- `getMetrics` emits histograms (`fillInnerMetricsSnapshot(histograms(), ...)`) but
`getAllMetricsNum` ignores them, under-reporting the count used for the
"number of metrics exceed the output metrics strings capacity" warning.
- [x] Yes
- [x] Yes
Labeled histograms report their own values instead of a shared aggregate, and the reported
total metric count grows by the number of histograms.
Added `test histogram with customized label` to `CelebornSourceSuite`: it registers
`PartitionFileSize` with `disk=disk1`/`disk=disk2`, updates them with different values and
asserts each label reports its own `_Max` plus `getAllMetricsNum == 2`.
./build/mvn -pl common scalatest:test -DargLine= -Dsuites=org.apache.celeborn.common.metrics.source.CelebornSourceSuite
passes (7 tests); the new test fails when either fix is reverted.
yew1eb
force-pushed
the
fix/metrics-histogram-label-keys
branch
from
October 28, 2026 13:19
b026047 to
43f9a92
Compare
This branch has not been deployed
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.
What changes were proposed in this pull request?
AbstractSource.addHistogramcomputes the label-aware keymetricNameWithLabelbutregisters the Dropwizard histogram under the bare
name, so every labeled variant of thesame histogram shares a single reservoir. It now registers under
metricNameWithLabel,consistent with
addTimer,addCounterandaddGauge.AbstractSource.getAllMetricsNumnow includesnamedHistogram.size(), so the metricscapacity warning counts what
getMetricsactually emits.Why are the changes needed?
PartitionFileSize) makes alllabeled variants read the same aggregated reservoir, so they report identical
Count/Max/percentiles. It is latent today because the only two histograms(
FetchChunkTransferSize,PartitionFileSize) carry no labels yet. Registering under thelabeled key also keeps a future
removeHistogram(name, labels)consistent with the othermetric types, which remove by the labeled key.
getMetricsemits histograms (fillInnerMetricsSnapshot(histograms(), ...)) butgetAllMetricsNumignores them, under-reporting the count used for the"number of metrics exceed the output metrics strings capacity" warning.
Does this PR resolve a correctness bug?
Does this PR introduce any user-facing change?
Labeled histograms report their own values instead of a shared aggregate, and the reported
total metric count grows by the number of histograms.
How was this patch tested?
Added
test histogram with customized labeltoCelebornSourceSuite: it registersPartitionFileSizewithdisk=disk1/disk=disk2, updates them with different values andasserts each label reports its own
_MaxplusgetAllMetricsNum == 2.passes (7 tests); the new test fails when either fix is reverted.