Skip to content

Create spans without exporting them - #9004

Open
brunobat wants to merge 3 commits into
open-telemetry:mainfrom
brunobat:exporter-noop
Open

brunobat wants to merge 3 commits into
open-telemetry:mainfrom
brunobat:exporter-noop

Conversation

@brunobat

@brunobat brunobat commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

A tracer has a second output channel that isn't the exporter. The SpanContext injected into outbound requests and into log records. This is what we just missed.
This PR adds otel.traces.exporter=noop and SpanProcessor.noop() to allow the creation of spans without the export part. This ensures previous behavior is maintained if people choose so.

Fixes #8740

This is the implementation described in comment #8740 (comment)

Not sure how to fix the config docs in the website.

@brunobat
brunobat requested a review from a team as a code owner November 4, 2026 12:18
@otelbot otelbot Bot added the api-change Changes to public API surface area label Nov 4, 2026
@otelbot

otelbot Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

⚠️ API changes detected — additional maintainer review required

@jack-berg @jkwatson

This PR modifies the public API surface area of the following module(s):

  • opentelemetry-sdk-trace

Please review the changes in docs/apidiffs/current_vs_latest/ carefully before approving.

@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Waiting on reviewers · refreshed 2026-11-19 22:26 UTC

Review the latest changes.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

@codecov

codecov Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.46%. Comparing base (0157b76) to head (677da66).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #9004   +/-   ##
=========================================
  Coverage     90.46%   90.46%           
- Complexity    11180    11186    +6     
=========================================
  Files          1032     1032           
  Lines         30500    30515   +15     
  Branches       3991     3996    +5     
=========================================
+ Hits          27591    27605   +14     
  Misses         1935     1935           
- Partials        974      975    +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jack-berg jack-berg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you add the implementation for declarative config as well?

I considered whether we should add noop support for logging / metrics as well, but landed on no. Tracing is the only signal where there is a distinction between noop and none. Adding to logging/metrics would be symmetry but adds confusion. Better to keep tracing as an exception and document the reason why.

Comment thread CHANGELOG.md Resolved
…s without exporting them

# Conflicts:
#	CHANGELOG.md
#	docs/apidiffs/current_vs_latest/opentelemetry-sdk-trace.txt
#	sdk/trace/src/main/java/io/opentelemetry/sdk/trace/TracerSharedState.java
@brunobat

Copy link
Copy Markdown
Contributor Author

@jack-berg I addressed the review comments.

@jack-berg
jack-berg enabled auto-merge (squash) November 18, 2026 22:10
@jkwatson

Copy link
Copy Markdown
Contributor

I'm fine with the API addition if Jack is ok with this approach.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-change Changes to public API surface area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No tracer provider in the OpenTelemetrySdk builder makes the application do a lot of work for spans that will be dropped

3 participants