Skip to content

feat(sdk): add default tracer configuration - #8772

Open
Debashismitra01 wants to merge 1 commit into
open-telemetry:mainfrom
Debashismitra01:feat/default-tracer-config
Open

feat(sdk): add default tracer configuration#8772
Debashismitra01 wants to merge 1 commit into
open-telemetry:mainfrom
Debashismitra01:feat/default-tracer-config

Conversation

@Debashismitra01

Copy link
Copy Markdown
Contributor

Description

Adds support for setting a default TracerConfig on SdkTracerProviderBuilder.

This provides a way to configure the default behavior of tracers created by the provider without requiring a condition for each instrumentation scope. Scope-specific tracer configurations can still override the default configuration.

Changes

  • Add setDefaultTracerConfig(TracerConfig) to SdkTracerProviderBuilder.
  • Configure the default tracer behavior through the existing ScopeConfigurator.
  • Preserve existing scope-specific configuration behavior.
  • Add tests covering the default tracer configuration.

Testing

  • SdkTracerProviderBuilderTest
  • SdkTracerProviderTest
  • OpenTelemetrySdkTest

Fixes #8740

@Debashismitra01
Debashismitra01 requested a review from a team as a code owner September 5, 2026 11:20
@otelbot otelbot Bot added the api-change Changes to public API surface area label Sep 5, 2026
@otelbot

otelbot Bot commented Sep 5, 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 Sep 5, 2026

Copy link
Copy Markdown

Pull request dashboard status

Waiting on the author · refreshed 2026-09-08 22:27 UTC

Resolve merge conflicts.

Respond to 1 review item (e.g. link a commit, explain why not, ask a follow-up):

  • Top-level threads: 1
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.
  • Should this be with reviewers? Comment /dashboard route:reviewers to route it to them.
  • Anything wrong — including the routing? Report it with what you expected; it helps us improve the dashboard.

@Debashismitra01
Debashismitra01 force-pushed the feat/default-tracer-config branch from 6a8da76 to d9f1a79 Compare September 5, 2026 19:30
@codecov

codecov Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.28%. Comparing base (c87b50e) to head (d9f1a79).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8772      +/-   ##
============================================
- Coverage     91.29%   91.28%   -0.01%     
- Complexity    10498    10502       +4     
============================================
  Files          1006     1006              
  Lines         28338    28342       +4     
  Branches       3581     3581              
============================================
+ Hits          25870    25873       +3     
- Misses         1675     1676       +1     
  Partials        793      793              

☔ 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.

This isn't how we should fix #8740. Instead, we should adjust the SdkTracerProvider behavior to have a noop-like behavior when no processors are registered.

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

2 participants