Skip to content

Toggle Support to Control Span Creation (Without Disabling Context Propagation) #14007

Open
@radhakrishnan10192

Description

@radhakrishnan10192

Is your feature request related to a problem? Please describe.

Description:

In high-traffic applications, the volume of spans created by the OpenTelemetry Java Agent can become costly to process and manage, particularly for messaging instrumentations (e.g., Kafka producer and consumer spans), which tend to generate a large number of spans.

While disabling the instrumentation entirely (via otel.instrumentation.[name].enabled=false) is possible, this also breaks context propagation — which is undesirable, as we still want trace context to propagate downstream.

As of now, I do not see a clear option to disable or suppress span creation at the instrumentation level while preserving context propagation.

Describe the solution you'd like

Introduce a per-instrumentation toggle such as:
otel.instrumentation.[instrumentation-name].experimental-span-suppression=true

(or an equivalent officially supported mechanism) to:

  • Suppress the creation of spans for a specific instrumentation (e.g., Kafka producer/consumer),
  • While still allowing trace context propagation (i.e., injection and extraction of context continues).

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestneeds triageNew issue that requires triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions