-
Notifications
You must be signed in to change notification settings - Fork 201
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
Handled / catched exceptions are getting into Azure Application Insights #3838
Comments
@chhauss-a can you share the stack trace where the exception is being thrown and where it's caught? |
Hey @heyams , thanks for looking into this issue! The exception that is thrown is the following:
The MongoLockProvider that I have mentioned above is catching the MongoServerException which the MongoCommandExceptions extends. |
Any updates on this issue so far? |
hi @chhauss-a! sorry for the delay, and thanks for the stack trace, can you do one more thing for us and enable self-diagnostic debug logging (e.g. env var this should show us which span that exception is being captured against which should help us narrow it down |
(specifically, if you can share any relevant |
Hey @trask, I have activated the diagnostic logs and this is the output from this morning, when both revisions wanted to get the lock: This is the revision that seems to have aquired the lock first:
And this is the revision, that came seconds and therefor could not aquire the lock:
Looking forward to hear from you! |
hi @chhauss-a, I'm surprised not to see any spans captured for the spring the reason this is relevant is that if the failing mongo span had a parent span, then we wouldn't capture the exception, since we can rely on it either being handled, or captured on the parent span have you by any chance turned off the spring scheduling instrumentation? e.g.
|
Hey @trask, I can confirm that We also haven't touched the spring scheduling instrumentation, so if it is turned on by default it should be. Does it make sense to set it to true anyway? Can I just set it in the If I can gather any other insights to help solve this issue please just ask. |
hi @chhauss-a, I tried, but I'm unable to reproduce what you are seeing can you look at https://github.com/trask/sched-lock-example? in that case, the Java agent captures the spring scheduling span, and because it is present, it doesn't capture the exception on the underlying database span i'm hoping you can tweak my example in a way that can exhibit the issue you're seeing? |
Hey @@trask, thanks for sharing your example. I've seen that you have added the application insights as dependency to the pom.xml. We do not have that. To build the container with our application we use a docker image that we build the following way: FROM eclipse-temurin:21-jre-alpine
EXPOSE 8080
RUN addgroup -S myuser && adduser -S myuser -G myuser
RUN apk -U add wget --no-cache && \
wget https://github.com/microsoft/ApplicationInsights-Java/releases/download/3.5.1/applicationinsights-agent-3.5.1.jar && \
mv applicationinsights-agent-3.5.1.jar applicationinsights-agent.jar
USER myuser
ENTRYPOINT ["java", "-javaagent:applicationinsights-agent.jar", "-jar"] Maybe that makes a difference? |
that's just being used to tell maven to download the agent jar to the it's still run the same way: and won't make a difference. can you create a small repro (or modify mine) in a way that allows us to reproduce and debug the issue you're seeing? |
Hey @trask , |
Expected behavior
We have a handled exception in our application. When that exception is thrown and catched we should not see the occurrence of that exception in Application Insights.
Actual behavior
The thrown and catched exception is displayed in our Application Insights.
To Reproduce
System information
Please provide the following information:
The text was updated successfully, but these errors were encountered: