-
Notifications
You must be signed in to change notification settings - Fork 205
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
Operation name/ Operation id missing for manual created threads #3569
Comments
@Charlie441324219 You can do the following thing to propagate the context: io.opentelemetry.context.Context context = io.opentelemetry.context.Context.current();
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
try (Scope scope = context.makeCurrent()) {
telemetry.trackEvent(baseHeaders, null, membershipNbr, "AI_LOG_CHILDREN_THREAD_THREAD")).start();
}
}
});
thread.start(); |
Hi @jeanbisutti , Thank you so much for your help, can you please provide more details about what condition context can auto propagate or what condition it cannot ? |
@Charlie441324219, The propagation context is automatically propagated between all the automatic instrumentations. So, the context is propagated to
|
Hi @jeanbisutti , thank you for your reply, can you please provide more details about how to identify if a JAVA asynchronous technology is automatic instrumentations or not ? |
hi @Charlie441324219, context is intentionally not propagated to manually created threads, see open-telemetry/opentelemetry-java-instrumentation#2527, other cases are generally handled |
Thank you @jeanbisutti @trask , |
Expected behavior
Parent thread pass Operation name/ Operation id to children thread
Actual behavior
Operation name/ Operation id is missing for manual created threads (new Thread().start()), but works fine with CompletableFuture.runAsync()
To Reproduce
System information
Please provide the following information:
Screenshots
The text was updated successfully, but these errors were encountered: