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

Open
#9,012 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

@goutamadwant is already working on this.

Since Nov 7, 2026.

  • #9017 by @goutamadwant — open

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

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:

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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from open-telemetry/opentelemetry-java

All issues in open-telemetry/opentelemetry-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.