Skip to content

Use per-instance IDs for SDK processors and metric readers - #9017

Merged
jack-berg merged 2 commits into
open-telemetry:mainfrom
goutamadwant:fix-sdk-component-identity
Nov 25, 2026
Merged

jack-berg merged 2 commits into
open-telemetry:mainfrom
goutamadwant:fix-sdk-component-identity

Conversation

@goutamadwant

Copy link
Copy Markdown
Contributor

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.name and 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

@goutamadwant
goutamadwant requested a review from a team as a code owner November 7, 2026 18:56
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Merged · refreshed 2026-11-25 22:20 UTC

Status above doesn't look right?
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

@codecov

codecov Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.46%. Comparing base (f67bf22) to head (4de7305).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@opentelemetry-pr-dashboard

This comment has been minimized.

@jack-berg jack-berg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolve merge conflicts and consider the following test simplification

Signed-off-by: goutamadwant <workwithgoutam@gmail.com>
@goutamadwant

Copy link
Copy Markdown
Contributor Author

I resolved the merge conflicts and pushed 4de7305. The processor and reader tests now use one collection to check for two distinct otel.component.name values with one event each, without depending on the numeric suffixes. All 13 focused SDK tests passed locally.

@jack-berg
jack-berg merged commit e446a0f into open-telemetry:main Nov 25, 2026
34 checks passed
@otelbot

otelbot Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution @goutamadwant! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Span/log processors and PeriodicMetricReader use static ComponentId, causing all instances to share otel.component.name "<type>/0"

2 participants