Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
dbarker opened this issue Dec 4, 2024 · 2 comments · Fixed by #3185
Closed

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

dbarker opened this issue Dec 4, 2024 · 2 comments · Fixed by #3185
Labels
bug Something isn't working triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@dbarker
Copy link
Contributor

dbarker commented Dec 4, 2024

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. ):

@dbarker dbarker added the bug Something isn't working label Dec 4, 2024
@github-actions github-actions bot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Dec 4, 2024
@dbarker
Copy link
Contributor Author

dbarker commented Dec 4, 2024

I've posted a draft PR. Let me know if it looks reasonable or if there are other concerns. I'd be happy to add a few more tests and then mark it ready for review.

@dbarker
Copy link
Contributor Author

dbarker commented Dec 6, 2024

I've updated the PR and marked it ready for review. Feel free to assign this issue to me.

@marcalff marcalff added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
2 participants