Skip to content

SuppressDownstreamInstrumentation option in OpenTelemetry.Instrumentation.GrpcNetClient instrumentation #1727

@vishweshbankwar

Description

@vishweshbankwar

Issue

The usage of SuppressDownstreamInstrumentation isn't supported when used with the rc/stable versions of OpenTelemetry.Instrumentation.Http instrumentation. The limitation comes from the changes introduced in open-telemetry/opentelemetry-dotnet#5077.

SuppressDownstreamInstrumentation relies on OpenTelemetry.Instrumentation.Http instrumentation to avoid overriding the injected ActivityContext by OpenTelemetry.Instrumentation.GrpcNetClient instrumentation. However, since OpenTelemetry.Instrumentation.Http doesn't depend on the SDK, this suppression isn't possible.

As a result, When OpenTelemetry.Instrumentation.GrpcNetClient is used with OpenTelemetry.Instrumentation.Http, the outgoing request will always contain the traceparent header set from ActivityContext of HttpClient Activity instead of GrpcClient Activity .

Workaround

Use beta versions of OpenTelemetry.Instrumentation.Http instrumentation if SuppressDownstreamInstrumentation is needed

Update(4/15): The workaround shared above is not recommended to be used due to GHSA-vh2m-22xx-q94f. Alternate options needs to be further evaluated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcomp:instrumentation.grpcnetclientThings related to OpenTelemetry.Instrumentation.GrpcNetClient

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions