-
Notifications
You must be signed in to change notification settings - Fork 440
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
Allow ending/deleting/destroying a span without having it be recorded #2389
Comments
Please note
So, once Span is created, and not sampled by Sampler, it would get ended and eventfully exported. One of the option is to create a custom span-processor which implements tail-based sampling. And for this to work, you also need a custom exporter which implements the |
@Falmarri do you have more queries, or can we close this issue ? |
For the potential API |
Closing, this feature is not supported by opentelemetry in general. Instead of creating a span and later "abandon" it, also consider to delay the span creation until the application can decide if it it needed or not. |
This is what I ended up doing, though it's not ideal because the next span could be one of several. And so there are a few places I have to lazily create the parent span. But it works. |
I have a somewhat annoying situation in my code that's kind of hard to explain, so I won't exactly go into it unless it's necessary. But the short story is sometimes I create a span, but later realize that the span isn't actually relevant to my workflow and I want to abandon it without recording it. The reason for this is that the system can create hundreds of thousands of spans, but only a small portion are relevant, and it's very hard for me to know beforehand whether it will be relevant or not.
I realize this is far from ideal, but I'm working in the bounds of an existing 3rd party library that my code is running as an extension of, so I don't have much of an option to change. I can probably come up with a workaround, but my first thought was just to create the spans always, but only record them after knowing they interact with my flow. Maybe there could be a
span->Abandon()
method or something like that?The text was updated successfully, but these errors were encountered: