Skip to content

Add programmatic span suppression configuration#19180

Open
trask wants to merge 11 commits into
open-telemetry:mainfrom
trask:add-programmatic-span-suppression-config
Open

Add programmatic span suppression configuration#19180
trask wants to merge 11 commits into
open-telemetry:mainfrom
trask:add-programmatic-span-suppression-config

Conversation

@trask

@trask trask commented Jul 10, 2026

Copy link
Copy Markdown
Member

Overview

Add Experimental.setSpanSuppressionStrategy(...) so library instrumentation can configure span suppression programmatically.

Configuration precedence is:

  1. programmatic API
  2. declarative instrumentation configuration
  3. deprecated otel.instrumentation.experimental.span-suppression-strategy system property
  4. default semconv strategy

The system property now logs a deprecation warning, is ignored when v3 preview is enabled, and is scheduled for removal in 3.0.

Migration

Replace:

-Dotel.instrumentation.experimental.span-suppression-strategy=span-kind

with either:

Experimental.setSpanSuppressionStrategy(instrumenterBuilder, "span-kind");

or the equivalent declarative instrumentation configuration.

Testing

  • ./gradlew :instrumentation-api:test --tests "io.opentelemetry.instrumentation.api.instrumenter.SpanSuppressionStrategyTest"
  • ./gradlew :instrumentation-api:spotlessJavaCheck :instrumentation-api:compileTestJava

Comment thread CHANGELOG.md Outdated
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Jul 10, 2026

Copy link
Copy Markdown

Pull request dashboard status

Status last refreshed: 2026-07-27 01:50:34 UTC.

  • Waiting on: Reviewers
  • Next step: Review the latest changes.

This automated status or its linked feedback items may be incorrect. If something looks wrong, please report it with the result you expected.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds programmatic span suppression configuration for library instrumentation.

Changes:

  • Adds Experimental.setSpanSuppressionStrategy(...).
  • Implements configuration precedence and deprecation warning.
  • Adds tests and migration notes.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
Experimental.java Exposes the programmatic setter.
InstrumenterBuilder.java Resolves suppression configuration and deprecated fallback.
SpanSuppressionStrategyTest.java Tests programmatic precedence and property reading.
CHANGELOG.md Documents deprecation and migration.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Comment thread CHANGELOG.md

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comment thread CHANGELOG.md
@trask
trask marked this pull request as ready for review July 10, 2026 17:49
@trask
trask requested a review from a team as a code owner July 10, 2026 17:49
trask added 3 commits July 11, 2026 11:05
…an-suppression-config

# Conflicts:
#	instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterBuilder.java
#	instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/internal/SemconvStability.java
…an-suppression-config

# Conflicts:
#	CHANGELOG.md
#	instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterBuilder.java

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@trask trask modified the milestones: v2.30.0, v2.31.0 Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants