Skip to content

Thread pool of long-lived workers builds up arbitrarily large traces #10563

Answered by laurit
Tomboyo asked this question in Q&A
Discussion options

You must be logged in to vote

Executor instrumentation propagates the context from calling the execute method into the Runnable. If execute was called inside some span then that span will be the parent of all the work that is going to happen inside the Runnable. One approach to avoid this would be to reset the context before calling execute with

try (Scope ignore = Context.root().makeCurrent()) {
  execute(...);
}

Another option would be to call

with the class name of the runnable.…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Tomboyo
Comment options

Answer selected by Tomboyo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants