Skip to content

Tracer and meter instrumentation scope attributes not included with otlp exportersΒ #3184

@dbarker

Description

@dbarker

Describe your environment

main branch at 150256c1720b279a1dfc7c380d17e13e90cee15d

$ gcc --version
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0

Build configuration.

cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DWITH_OTLP_GRPC=ON \
-DWITH_ABI_VERSION_2=ON \
-DWITH_ABI_VERSION_1=OFF \
-DWITH_ASYNC_EXPORT_PREVIEW=ON \
-DWITH_METRICS_EXEMPLAR_PREVIEW=ON \
-DWITH_OTLP_GRPC_SSL_MTLS_PREVIEW=ON \
-DWITH_OTLP_FILE=ON \
-DWITH_EXAMPLES=ON \
-DWITH_BENCHMARK=OFF \
-DOPENTELEMETRY_INSTALL=ON .. 

Steps to reproduce

  1. Create a Meter Provider or Tracer Provider with the OTLP grpc exporter.
  2. Create a tracer or meter with instrumentation scope attributes
   auto tracer = provider->GetTracer("my_scope_name", "my_scope_version", "my_scope_schema_url", {{"scope_key", "scope_value"}});

   auto meter = provider->GetMeter("my_scope_name", "my_scope_version", "my_scope_schema_url", {{"scope_key", "scope_value"}});

  1. Receive the OTLP telemetry data with an otel-collector configured with the debug exporter.
  2. The instrumentation scope level attributes are not observed in the collector's debug output.

What is the expected behavior?
The OTLP debug output from the otel-collector should include the instrumentation scope attribute ("scope_key", "scope_value").

What is the actual behavior?
The OTLP debug output does not include the instrumentation scope attributes.

Additional context
Code to set the Instrumentation Scope attributes for logs can be found at otlp_recordable_utils.cc#L173. The debug output from the otel-collector confirms these attributes are included in the otlp message for logs.

Code to set the Instrumentation Scope attributes to the proto::common::v1::InstrumentationScope message is missing for metrics (otlp_metric_utils.cc#L252) and traces (otlp_recordable_utils.cc#L107. ):

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage/acceptedIndicates an issue or PR is ready to be actively worked on.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions