Open marcalff opened 1 month ago
Thanks for raising the issue. Just to add the approach used by otel-python - https://github.com/search?q=repo%3Aopen-telemetry%2Fopentelemetry-python%20_SUPPRESS_INSTRUMENTATION_KEY%20&type=code
true
in the current active context - this can be done at the start on the Exporter::export() method, and set back to false
at the end.true
.However, this approach has some constraint. Any instrumentation that needs to be suppressed in the libraries used by the OTLP exporter should be invoked from the exporter thread since the active context is thread-local in otel-cpp.
Similar approach used in otel-dotnet - https://github.com/open-telemetry/opentelemetry-dotnet/blob/1a836432840d657926923ccce4d09c4a4e08728c/src/OpenTelemetry/SuppressInstrumentationScope.cs#L12
Here is a similar issue with a fix (OTel-C++ but a different gRPC-based exporter): https://github.com/googleapis/google-cloud-cpp/issues/14611
The grpc C++ library is instrumented using opentelemetry-cpp:
The opentelemetry-cpp OTLP GRPC exporter uses grpc
In the OTLP GRPC exporter implementation, opentelemetry-cpp needs to:
so avoid infinite recursion.
This is blocking:
This is blocked by the spec: