-
Notifications
You must be signed in to change notification settings - Fork 872
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
Feature Request: Allow @WithSpan to start a new Trace #1036
Comments
@jkwatson do you want that before GA or we can deliver it after GA? |
No strong opinions from my side. I'm happy to write the manual instrumentation without the annotation...I can't speak for other not-so-deep-into-the-project users, though. |
I know this conversation was quite a while ago but we are running into a specific situation in our code base where this would be incredibly helpful. Currently we have an issue where jobs being kicked off by an internal scheduler in the service are all being grouped as a single "trace" when we would really like to split them up and being able to add a simple "@WithTrace" (or a parameter in @WithSpan) to it would be immensely useful. |
hey @azizabah, just wanted to check if you already know how to solve this using OpenTelemetry API, and are just looking for a more convenient way via annotation? |
@trask - No I'm not aware of how to solve it. I was reading here: https://opentelemetry.io/docs/instrumentation/java/manual/ but everything seemed to be focused on spans and not traces so I wasn't sure what the path forward would be. |
try this:
|
I'm not sure how many configuration options we want to add to @zeitlinger @jack-berg this could be a good use case for a convenience API somewhere in between |
Another duplicate of this issue: open-telemetry/opentelemetry-java#5837
Agreed 👍 |
Currently, if you use the
@WithSpan
annotation, it will always join in the current trace, if there is one in scope. It would be useful to be able to tell the agent that we don't want to preserve the parenting, but create a new TraceId for the span.This can be useful if you want background jobs that are spawned based on a request to appear as their own trace, rather than joining in the existing trace.
Bonus points: an option to Link the new span to the one that spawned it.
The text was updated successfully, but these errors were encountered: