Skip to content
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

Application Insights logs handled exceptions (using Polly) #2612

Open
piotrzbyszynski opened this issue Oct 23, 2020 · 6 comments
Open

Application Insights logs handled exceptions (using Polly) #2612

piotrzbyszynski opened this issue Oct 23, 2020 · 6 comments

Comments

@piotrzbyszynski
Copy link

Repro steps

The problem occurs while using Polly library, when using Policy.Handle<HttpRequestException>().RetryAsync() (inside Azure Function). When the exception happens it is logged by application insights although in my opinion it should be regarded as handled

Expected behavior

No exception should be logged

Actual behavior

Exception is logged and is visible request timeline in application insights

Related information

Any thoughts would be much appreciated

@piotrzbyszynski
Copy link
Author

Any news on that?

@george-ayris
Copy link

I have also just hit this issue and am wondering why it's happening

@MatheusXavier
Copy link

I'm having the same problem, the Polly is handling the exception but the exception is still being logged in Application Insights, any ideas on how to solve this?

@Orionsgate
Copy link

I'm running into the same thing.

There is apparently a way to filter out what gets written to app insights; you can write a custom TelemetryProcessor which can check the type of exception before deciding to proceed with logging it or not, but that's not ideal.

I don't want to filter on specific types; I want to filter on whether I'm already handling it with Polly. E.g. if I'm handling SomeException using Policy.Handle in Function A, SomeException shouldn't make it into app insights, but if Function B doesn't handle SomeException then in those cases SomeException should make it into App Insights.

Has anyone come across a better solution? Ultimately I think Polly will need updating.

@josealbertocoronado
Copy link

josealbertocoronado commented Aug 4, 2023

Morning.
Same issue here.
It creates a lot of unnecessary noise in Insights, so it would be really nice indeed to get a solution for this.

Cheers.

@vincelee888
Copy link

We thought we had the same issue, but the exceptions that triggers a retry is logged with a severity level of 2, so can be filtered out on that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants