Repository navigation
Use per-instance IDs for SDK processors and metric readers - #9017
goutamadwant wants to merge 2 commits into
Conversation
Pull request dashboard statusWaiting on maintainers · refreshed 2026-11-19 22:26 UTC Merge when ready. Status above doesn't look right?
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9017 +/- ##
=========================================
Coverage 90.45% 90.46%
- Complexity 11181 11182 +1
=========================================
Files 1032 1032
Lines 30507 30504 -3
Branches 3992 3992
=========================================
- Hits 27595 27594 -1
Misses 1935 1935
+ Partials 977 975 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This comment has been minimized.
This comment has been minimized.
jack-berg
left a comment
There was a problem hiding this comment.
Resolve merge conflicts and consider the following test simplification
| List<String> previousNames = null; | ||
| for (int count = 1; count <= 2; count++) { |
There was a problem hiding this comment.
Optional simplification: could we emit once and flush once, then assert the following instead of looping and tracking previousNames?
assertThat(metric.getLongSumData().getPoints())
.hasSize(2)
.allSatisfy(p -> assertThat(p.getValue()).isEqualTo(1))
.extracting(p -> p.getAttributes().get(OTEL_COMPONENT_NAME))
.doesNotContainNull()
.doesNotHaveDuplicates();This directly catches the static-ID regression: the old implementation produces one point with value 2. The log and reader tests could use the same single-collection approach.
Signed-off-by: goutamadwant <[email protected]>
|
I resolved the merge conflicts and pushed |
Fixes #9012.
Create a separate component ID for each simple or batch span processor, simple or batch log processor, and periodic metric reader. The static IDs caused multiple instances of the same component type to share an
otel.component.nameand collapse into one self-observability metric series. Periodic readers retain their instance ID when their meter provider is installed.Regression tests create two instances of each component type and verify distinct names, stable identities, and separate measurements across repeated collections. Existing metric assertions continue to check the exact attribute sets while allowing instance-specific names.
Validation:
./gradlew :sdk:trace:check :sdk:logs:check :sdk:metrics:check