-
Notifications
You must be signed in to change notification settings - Fork 199
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
Custom RequestTelemetry & RemoteDependencyTelemetry is no longer working with SDK when using Java 3.0 agent #1442
Comments
Hi @ajaythakran, thanks for reporting this! There are a couple of issues here:
Both of these issues should be resolved by #1448, and we are planning to put out 3.0.2 release shortly for this and #1444. |
Hi @trask, thanks for quick turnaround. We use following statement to set the request telemetry context which we assume to be made available for child dependencies span (include the one done with OpenTelemetry): Will this method continue to work with new Agent 3.0 using interop or There is an alternative? |
hey @ajaythakran, are you doing something like this?
|
re-opening as there is still a remaining question/issue |
@ajaythakran I think your best bet for this use case:
Is going to be using the OpenTelemetry API support (which is currently preview): https://github.com/microsoft/ApplicationInsights-Java/wiki/OpenTelemetry-API-support OpenTelemetry API should be 1.0 in a month or so, at which time we will move this support out of preview (and support OpenTelemetry API 1.0+). In OpenTelemetry API, the above would look something like:
Note: if you are parsing a W3C |
Yes I am doing this way. Besides setting traceId and parentSpanId, I am also setting spanId after creating new Traceparent based on received traceId .
Thanks for notes on OpenTelemetry API. I will be looking forward for its 1.0 version. |
Hey @trask, I gave a quick try with new version 3.0.2 and noticed following issues:
|
hey @ajaythakran, thanks for all the feedback! (1), (2) and (4) should be fixed by #1454 In case you have a chance to try it out, I'm attaching the CI build from PR #1454: very interested to see what else you find 😄👍 |
Hey @trask Thanks for beta with fixes. I gave a quick try to beta version 3.0.3 and noticed following issues:
|
(1) should be fixed now In case you have a chance to try it out again, I'm attaching the latest CI build: applicationinsights-agent-3.0.3-BETA-SNAPSHOT.jar.zip Let us know what else you find! |
Hi @trask , Last reported issues are fixed but following issue came back:
It would be nice to have operation method by default part of operation name for http request/dependencies (same as v2.x) as it plays important role in respect with REST services. I saw preview of processors to enable it but doesn't seem to work for me. |
How are you setting the Operation Name on your custom request telemetry? I'm not seeing the same issue when testing it:
It sounds like you already tried the example here? https://docs.microsoft.com/en-us/azure/azure-monitor/app/java-standalone-upgrade-from-2x#prefix-the-operation-name-with-the-http-method-get-post-etc Can you provide an example of an auto-collected request telemetry that it's not being applied to? that might give us some clues why it's not working for you. E.g. when I try on spring-petclinic, I see this: Thanks! |
Hi @trask, All previously mentioned issues are resolved.
New Issue:
|
EDIT: I'm not sure about this, because it won't play nicely with configuring the operation name via telemetry processors, need to think on this some more...
Do you mean the request telemetry you are viewing in the portal is missing that data, or when you call
it is not working? |
Lets say for custom request telemetry, the source is set using below code:
With agent 3.0.3, it is not available in application insights. |
hi @ajaythakran, this should work now in the latest SNAPSHOT: applicationinsights-agent-3.0.3-BETA-SNAPSHOT.jar.zip |
Hi @trask , I tried this version but still not able to find Source in Telemetry details at Azure Application Insights. |
oh no, I didn't read carefully, and solved this different problem 😂:
|
hey @ajaythakran, here's the latest SNAPSHOT from CI that I believe addresses what you are looking for: |
Hi @trask It worked! When are you planning to release this version 3.0.3. I was thinking to submit this version to our performance team for review. |
hey @ajaythakran, we are planning to release 3.0.3-BETA end of this week or beginning of next week. |
3.0.3-BETA is released! |
Expected behavior
Application Insights Java SDK v2.6.2 must work with Agent 3.0 as it used to work with Agent 2.6.2:
Actual behavior
The telemetry events work fine without Agent v3.0.
When Agent v3.0.1 is used, following errors are seen in log:
AI: ERROR 18-01-2021 01:17:01.697+0000, 85(XNIO-2 task-1): Failed to generate child ID. Exception information: java.lang.RuntimeException: ThreadContext.getRequestTelemetryContext().getRequestTelemetry().getContext().getOperation() is not supported by the Application Insights for Java 3.0 agent
java.lang.RuntimeException: ThreadContext.getRequestTelemetryContext().getRequestTelemetry().getId() is not supported by the Application Insights for Java 3.0 agent at com.microsoft.applicationinsights.telemetry.RequestTelemetry.getId(RequestTelemetry.java:161) ~[applicationinsights-web-2.6.2.jar:na]
Requesting Fix or Updated Guide on SDK usage w.r.t. Agent v3.0
As per new documentation at https://docs.microsoft.com/en-us/azure/azure-monitor/app/java-in-process-agent, I noticed that the support for above mentioned operations is removed while using Agent 3.0.
But SDK is not useful if there is no way to Set current span in thread context or Access current parent span information. This is required specifically to start new span based on propagated correlation on consumption of message from system like Azure Service Bus Message or to propagate correlation headers (completes asynchronously) for dependency like Azure Service Bus Message. This will also include collection of telemetry request (on consuming) or dependency (on producing) respectively.
Could you please enable support for mentioned operations with Agent 3.0 or provide us guidance on how to use given SDK 2.6.2 for sending custom telemetry events RequestTelemetry & RemoteDependencyTelemetry
System information
Please provide the following information:
The text was updated successfully, but these errors were encountered: