Skip to content

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

Open

Description

@dashpole

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions