Anyone having similar issues?
Unable to filter out exceptions using "ITelemetryProcessor" in Azure Web API
I have a Azure Web API were I try to ignore a specific exception from being shown in Application Insight:
In order to do so, I need to inspect the exception message that is related to the exception being thrown (defined in the "ReasonPhrase"):
My problem is that the code logic for "ExceptionTelemetry" never seems to be executed.
Here is my implementation of the ITelemetryProcessor:
I need the code line marked in yellow to be hit, but it seems that I never get any "ExceptionTelemetry".
NB! When I run the code locallly, I see that other types of telemetry data is fetched (like "RequestTelemetry" etc.) So the ITelemetryProcessor seems to trigger at least, but not on my specific exception...
Any tips on what I need to do to achieve this?
Marius H. Enerud
It seems that no ExceptionTelemetry data is being created when throwing HttpResponseException (even if HttpResponseException dervies from the Exception class).
It only triggers RequestTelemetry, but I can't find the "ReasonPhrase" there, so I'm not able to filter it out...
I tested throwing a normal exception and that triggered the ExceptionTelemetry as expected. But my problem is that I need to use HttpResponseException for the clients...
Sign in to comment