-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Filter out/reject traces with a single span with "and logic" based on an attribute #29093
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Pinging code owners for pkg/ottl: @TylerHelmuth @kentquirk @bogdandrutu @evan-bradley. See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Hello @droonee, I believe this is actually a pretty involved request. The filter processor filters traces at the span level, with no context of the trace as a whole. This means we'd need to re-architect the scope of the filtering logic in the processor itself and make sure it's backwards compatible to existing filters. Also, the filtering logic is done by OTTL at the span context level. The span context in OTTL only has span-level information available, not trace. So this may require a whole new trace context to be added to OTTL. For context, I'll just share that there's another open request (#28875) to compare values across spans within the same trace, so multiple people are looking for functionality similar to this. I'll defer to code owners for more information though. I'm not super familiar with the internal workings of these components so I may have even missed something obvious. I'm also aware this may get into much bigger architectural discussions that others would be much better suited for. |
@droonee, @crobert-1 is correct that the filterprocessor doesn't know about the state of a trace as a whole. I do believe you could do this with the tailsamplingprocessor. IF the name of the span is consistent, you could look for the parent span id to be nil to identify it as a root span. If your situation means that the solo span scenario is the root span, you could do this in the filterprocessor.
|
Pinging code owners for processor/tailsampling: @jpkrohling. See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Hi. I feel like It's easy to impl the following logic with tail sampling processor: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/tailsamplingprocessor if span_name == "xxx" and span_count_in_a_trace == 1 {
drop_the_trace
} I cannot write the whole config on phone but I believe that's not difficult for ya. Feel free to comment if you need further help. |
Agree, a combination of span_count and string_attribute should accomplish what's been requested. |
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
@droonee Were you able to get this working? Is there anything left here or can we close the issue? |
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
I'm closing this, feel free to reopen if it's still a problem. |
Component(s)
processor/filter
Is your feature request related to a problem? Please describe.
I am ingesting traces into a backend and processing trace data to control cost.
I have a few examples of traces that only contain a single span. Span A will usually be nested in a full trace but sometimes will populate a unique trace with one span, i.e. Trace with only Span A. I want to eliminate the occurrence of Span A when it is the only span in a trace but don't want to eliminate other traces with a single span - in this case, I will need to also be specific about the span based on an attribute, i.e. span name.
Describe the solution you'd like
I'd like to reject traces with a single span that also contain a specific span name (or customer attibrute).
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: