Comments (7)
@Charlie441324219 CompletableFuture
is auto-instrumented but Thread
is not.
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();
from applicationinsights-java.
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 ?
from applicationinsights-java.
de 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 CompletableFuture
and the HTTP request can be known.
Thread
is not automatically instrumented. So, the context is not automatically propagated into the methods of Thread
, and it is needed to programmatically propagate the context.
from applicationinsights-java.
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 ?
from applicationinsights-java.
See https://learn.microsoft.com/en-us/azure/azure-monitor/app/opentelemetry-add-modify?tabs=java
from applicationinsights-java.
hi @Charlie441324219, context is intentionally not propagated to manually created threads, see open-telemetry/opentelemetry-java-instrumentation#2527, other cases are generally handled
from applicationinsights-java.
Thank you @jeanbisutti @trask ,
from applicationinsights-java.
Related Issues (20)
- TimeoutException when ingesting logs into AI HOT 13
- Help to ignore InProc sampling dependencies HOT 5
- Problem to configure sampling override HOT 6
- Auto-instrumentation support for Pekko 1.0.0 in Java agent HOT 2
- Q: regarding agent not being able to attach. HOT 5
- TRACE log level causes an application to fail HOT 11
- [Question] Why relocate logback packages and configuration files HOT 2
- How to add a Prefix to the names of the default captured metrics HOT 4
- Azure function app integration to Dynatrace in Linux with Open telemetry HOT 2
- HTTP dependencies are not reported in latest Spring Boot 3.2. HOT 2
- Download URL format changed in 3.5.0 HOT 3
- Azure ApplicationInsights stopped reporting Query paramters in Request traces - With 3.5.0 HOT 1
- Adding per-worker metrics reported to JMX in applicationinsights.json for App Insights HOT 4
- Question: azure log analytics workspace migration HOT 1
- Q: regarding client secrets support HOT 1
- CVE-2023-52428 HOT 2
- Application Insights runtime attach agent metric-filtering not working HOT 10
- Is there a way to sample overrides Servicebus requests? HOT 18
- Workflow failed: OWASP dependency check (daily) (#532) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from applicationinsights-java.