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

Offen
#9,012 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 2 Tagen

@goutamadwant arbeitet bereits daran.

Seit 07.11.2026.

  • #9017 von @goutamadwant — offen

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
68/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
java

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
Java
Sterne
2.5k
Forks
1k
Ø Merge
4 T. 3 Std.
Gemergte PRs (30 T.)
52

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus open-telemetry/opentelemetry-java

Alle Issues in open-telemetry/opentelemetry-java

Ähnliche Issues

Weitere Issues zu Java

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.