Skip to content

Conversation

@xrmx
Copy link
Contributor

@xrmx xrmx commented Dec 17, 2025

Description

Implement part of the tracing SDK spec to configure the tracers https://opentelemetry.io/docs/specs/otel/trace/sdk/#configuration

At the moment this adds helper in order to enable or disable a tracer after it has been created.

The spec in is development so attributes, helpers and classes are prefixed with underscore.

TODO:

  • hook into sdk configuration
  • add an example rule based configurator so that we can express the tracer filter by name there

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • tox

Does This PR Require a Contrib Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

Implement part of the tracing SDK spec to configure the tracers
https://opentelemetry.io/docs/specs/otel/trace/sdk/#configuration

At the moment this adds helper in order to enable or disable a tracer
after it has been created.

The spec in is development so attributes, helpers and classes are
prefixed with underscore.

TODO: hook into sdk configuration
@xrmx xrmx requested a review from a team as a code owner December 17, 2025 11:40
id_generator: Optional[IdGenerator] = None,
span_limits: Optional[SpanLimits] = None,
*,
_tracer_configurator: Optional[_TracerConfiguratorT] = None,
Copy link
Member

Choose a reason for hiding this comment

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

This was the java thing I was mentioning: https://github.com/open-telemetry/opentelemetry-java/tree/main/api/incubator

I agree it might be overkill for this feature though.



_TracerConfiguratorT = Callable[[InstrumentationScope], _TracerConfig]
_TracerConfiguratorRulesPredicateT = Callable[
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess a callable is not very declarative config friendly

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