Span/log processors and PeriodicMetricReader use static ComponentId, causing all instances to share otel.component.name "<type>/0"
Maintainers usually reply within 2 days
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- java
- Domain
- observability-sre
Research direction
Read the five processor and reader source files linked in the issue, then inspect how GrpcExporterBuilder and HttpExporterBuilder generate ComponentId values. Check the related tests for component names and add coverage for multiple instances of each affected class. Done means instances receive distinct otel.component.name values such as <type>/0 and <type>/1, with the SDK tests passing.
Written by the indexing model from the issue text.
Description
Description
In the following classes, COMPONENT_ID is declared as private static final ComponentId instead of an instance field:
- https://github.com/open-telemetry/opentelemetry-java/blob/be7de06cd7d1c1154be14bfcae1f83d52503b8e9/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/export/BatchSpanProcessor.java#L47-L48
- https://github.com/open-telemetry/opentelemetry-java/blob/be7de06cd7d1c1154be14bfcae1f83d52503b8e9/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/export/SimpleSpanProcessor.java#L41
- https://github.com/open-telemetry/opentelemetry-java/blob/be7de06cd7d1c1154be14bfcae1f83d52503b8e9/sdk/logs/src/main/java/io/opentelemetry/sdk/logs/export/BatchLogRecordProcessor.java#L45-L46
- https://github.com/open-telemetry/opentelemetry-java/blob/be7de06cd7d1c1154be14bfcae1f83d52503b8e9/sdk/logs/src/main/java/io/opentelemetry/sdk/logs/export/SimpleLogRecordProcessor.java#L42
- https://github.com/open-telemetry/opentelemetry-java/blob/be7de06cd7d1c1154be14bfcae1f83d52503b8e9/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/export/PeriodicMetricReader.java#L46-L47
Because COMPONENT_ID is static, ComponentId.generateLazy(...) is only invoked once per class load, so every instance of BatchSpanProcessor, SimpleSpanProcessor, BatchLogRecordProcessor, SimpleLogRecordProcessor, or PeriodicMetricReader in the JVM reports <type>/0 for otel.component.name (unlike GrpcExporterBuilder and HttpExporterBuilder, which call ComponentId.generateLazy(...) per exporter instance).
Expected behavior
Each processor and metric reader instance should generate its own ComponentId (<type>/0, <type>/1, ...) so otel.component.name uniquely identifies each instance.
- Dominant language
- Java
- Stars
- 2.5k
- Forks
- 1k
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 49
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from open-telemetry/opentelemetry-java
-
Retry-After parser accepts invalid delay-seconds valuesPossibly taken @Dhruvraj-Rana claimed this today. OpenBug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
open-telemetry/opentelemetry-java#9018 ·
Maintainers usually reply within 2 days
-
PrometheusComponentProvider promotes all resource attributes when resource_constant_labels is empty ({})Possibly taken @rooks-ns claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
open-telemetry/opentelemetry-java#9014 ·
Maintainers usually reply within 2 days
-
MetricReusableDataMarshaler passes MetricData count instead of data point count to otel.sdk.exporter.metric_data_point.{inflight,exported}Possibly taken @goutamadwant claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
open-telemetry/opentelemetry-java#9011 · 1 comment ·
Maintainers usually reply within 2 days
-
Fix `otel.sdk.log.created` counting semanticsPossibly taken @anuraaga claimed this 94 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
open-telemetry/opentelemetry-java#8688 ·
Maintainers usually reply within 2 days
-
Add experimental view_matching_mode (composable metric views) supportPossibly taken @rooks-ns claimed this today. Open
Difficulty 5/5 Over a week Newbie friendliness 35/100
open-telemetry/opentelemetry-java#9013 ·
Maintainers usually reply within 2 days
All issues in open-telemetry/opentelemetry-java
Similar issues
-
Document and enforce pull request review guidelinesPossibly taken @dashorst claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
`Time.at(t, in: nil)` returns UTC instead of the local time (or the time zone of `t`), unlike CRubyOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
hermes-queue
Difficulty 1/5 Under an hour Newbie friendliness 72/100
chrisalunlloyd2-sudo/mindpalace#349 ·
Maintainers usually reply within 1 day
-
bug priority: medium Review effort [1-5]: 2 status: needs-triage type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
carlos-emr/carlos#5818 ·
Maintainers usually reply within 1 day
-
bug good first issue help wanted tooling
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
appmonster007/kmip-adapter#100 ·