-
Notifications
You must be signed in to change notification settings - Fork 761
opentelemetry-sdk: make it possible to customize processors configuation #4806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…tion Make it easier for distributions to override the processors set up by the sdk configurator by specifying a span processor and a log record processor.
| exporter_args = exporter_args_map.get(exporter_class, {}) | ||
| provider.add_span_processor( | ||
| BatchSpanProcessor(exporter_class(**exporter_args)) | ||
| span_processor(exporter_class(**exporter_args)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is failing pyright check because Type[SpanProcessor] does not impose a constructor that takes an exporter as first parameter. Need to type that I guess.
| id_generator: IdGenerator | None = None, | ||
| setup_logging_handler: bool | None = None, | ||
| exporter_args_map: ExporterArgsMap | None = None, | ||
| span_processor: Type[SpanProcessor] | None = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the same for every exporter, is it enough or we want to make it per exporter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might make the API too ugly, but we could do
span_processors: dict[str, Type[SpanProcessor] | None = None,
default_span_processor: Type[SpanProcessor] | None = None
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the current code we call just one processor wrapping the exporter class, what I was asking if people with multiple exporters may want to use a different processor depending on the exporter, similar on how we handle the exporters args as exporter_args_map.
Description
Make it easier for distributions to override the processors set up by the sdk configurator by specifying a span processor and a log record processor.
Type of change
Please delete options that are not relevant.
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
Does This PR Require a Contrib Repo Change?
Checklist: