Skip to content

JdkHttpSender does not suppress instrumentation of exporter requests #8755

Description

@thswlsqls

Describe the bug
JdkHttpSender.send() does not wrap its HTTP call in InstrumentationUtil.suppressInstrumentation(...), so when the OpenTelemetry Java agent is attached and instruments the JDK HttpClient, the exporter's own OTLP requests are recorded as CLIENT spans.

Steps to reproduce
Attach the Java agent to an application, configure an OTLP HTTP exporter backed by the JDK sender (opentelemetry-exporter-sender-jdk on the classpath instead of the okhttp sender), and export any signal.

What did you expect to see?
No spans for exporter requests. OkHttpHttpSender.send() (exporters/sender/okhttp/src/main/java/io/opentelemetry/exporter/sender/okhttp/internal/OkHttpHttpSender.java line 173), the other HttpSender implementation, already suppresses them.

What did you see instead?
A CLIENT span per export request. JdkHttpSender.send() (exporters/sender/jdk/src/main/java/io/opentelemetry/exporter/sender/jdk/internal/JdkHttpSender.java line 168) submits the request with no suppression.

What version and what artifacts are you using?
Artifacts: opentelemetry-exporter-sender-jdk
Version: main @ 3a9fdc6 (also present in 1.65.0)
How did you reference these artifacts? Built from source.

Environment
Compiler: Temurin 21
OS: N/A

Additional context
Suppression was introduced for the okhttp sender in #5918. Follow-ups covered the zipkin (#5967) and jaeger (#5969) exporters, but not the JDK sender.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions