[connector/spanmetrics] Skip resource iteration in resetState when nothing needs resetting - #50925
Open
KimMJ wants to merge 2 commits into
Open
[connector/spanmetrics] Skip resource iteration in resetState when nothing needs resetting#50925KimMJ wants to merge 2 commits into
KimMJ wants to merge 2 commits into
Conversation
…thing needs resetting The early-return guard in resetState still required Histogram.Disable, but since open-telemetry#32210 histograms only add work to the loop when exemplars are enabled. With the default configuration (cumulative, histograms enabled, exemplars off, no expiration) every flush iterated over all cached resources under the connector lock without doing anything. Drop the Histogram.Disable condition so the loop only runs when exemplar clearing, series expiration or metrics expiration is configured. Assisted-by: Claude Opus 5
Assisted-by: Claude Opus 5
Contributor
|
Welcome, contributor! Thank you for your contribution to opentelemetry-collector-contrib. Important reminders:
|
Member
|
/workflow-approve |
Author
|
/rerun |
Pull request dashboard statusWaiting on reviewers · refreshed 2026-09-12 04:39 UTC Review the latest changes. Status above doesn't look right?
|
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.
Description
p.config.Histogram.Disablecondition inresetState()function becomes stale from #32210 change. This makesp.config.Histogram.Disablecondition as no-ops, causem.histograms.ClearExemplars()is called only whenp.config.Exemplars.Enabled && !p.config.Histogram.Disable. So when histogram is enabled (default) and exemplar is disabled (default), early return is false and need to loop through resource cache even though iteration doesn't call clearing exemplar.Link to tracking issue
N/A. Found small issue during investigation and create PR since it is small fix.
Testing
created minimal test case. confirmed it failed before change, passed after change.
before
after
Documentation
No update.
Authorship