-
Notifications
You must be signed in to change notification settings - Fork 753
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
Multiple processors on tracer: configuration #286
Multiple processors on tracer: configuration #286
Conversation
var tasks = new List<Task>(); | ||
foreach (var processor in this.processors) | ||
{ | ||
tasks.Add(processor.ShutdownAsync(cancellationToken)); |
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.
perhaps some protection from processors returning null
task can be added here.
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.
so "WhenAll" will not crash
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.
still, protecting from anything in multi-processor makes no sense (it's optional and only present when advanced config with multiple processors is used), if some processor is misbehaving - we should not hide it here. may be catch in span.End()
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.
i did exception handling in start/stop, but not her. We don't await WhenAny here and chances are it throws OperationCancelledException, so users will have to try/catch it anyway.
src/OpenTelemetry/Trace/Configuration/SpanProcessorPipelineBuilder.cs
Outdated
Show resolved
Hide resolved
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.
I think this design is great for filtering and enriching telemetry.
Is this going to be the recommended approach for Span filtering? e.g. if I don't want to export any spans for a health check endpoint would people put that logic in a filtering processor? |
Nope. But this is the only one available today. There are discussions: open-telemetry/opentelemetry-specification#300 and #251. Basically
|
@lmolkova is the "draft" in title still means draft? Or we can merge it in? |
@SergeyKanzhelev still draft, need docs, tests, some clean up. I will probably finish it on the next week. |
dee4b30
to
e5a5041
Compare
Not draft anymore. Will keep it open for a few days to get more feedback. |
Co-Authored-By: Sergey Kanzhelev <S.Kanzhelev@live.com>
e5a5041
to
440bf0a
Compare
merging now. Feel free to add feedback here or file an issue if you are not happy with it. |
@lmolkova I'd like to filter some things by specifying my own predicate here but I see this is still only internally available. Is there a reason for that? |
The reason is filtering API is not very user friendly and very likely to change. Since this is rather advanced configuration and not the first priority (P1 is shipping OTel core packages in beta and GA), I decided to keep it internal until we have any cycles to understand requirements for this API and make it usable. Also, it seems there is no 'early' filtering concept available in OTel. If you need it, I believe there are three ways to proceed:
|
Fixes #226: tracers should allow multiple processors to be registered on them.
Processors are executed sequentially.
At the same time it should be possible to chain processors (e.g. filter or enrich + export).
This PR attempts to fix both.
In the example
all pipelines work together on each span.
Assuming there are
Use
extensions it looks not that bad.But advanced use case (without
Use
sugar) looks a bit scary