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

ParentId is not set #13

Closed
ursenzler opened this issue Mar 21, 2017 · 7 comments
Closed

ParentId is not set #13

ursenzler opened this issue Mar 21, 2017 · 7 comments
Labels

Comments

@ursenzler
Copy link

I found out that when I send Error data to ApplicationInsights, the telemetry data misses the ParentId. The result is that the error is not correctly correlated with the root operation. No exception data is provided when looking at a failed request (just "Learn how to track exceptions for failed requests").

Also see http://stackoverflow.com/questions/42858598/exceptions-are-not-shown-in-request-details-but-under-server-exceptions-in-appli

Unfortunately, I have no clue what changes are needed to get the parent Id so that it could be set inside OperationIdTelemetryInitializer

@marcinbudny
Copy link
Owner

I'll investigate the problem later this week. In the meantime, could you please provide me with a simple repro project - so that I know exactly what the problem is?

@marcinbudny
Copy link
Owner

Were you able to create a repro project for this?

@ursenzler
Copy link
Author

Unfortunately not. I need the help of a colleague because my OWIN knowledge is limited. And I didn't find time with him yet.

@ursenzler
Copy link
Author

I created a simple repro project at https://github.com/ursenzler/AspNetOwinApplicationInsightsTest

A single controller with a single method throwing an exception.
Exception is sent to Appinsights in a Filter (see Startup.cs).

@marcinbudny
Copy link
Owner

Remove following line from your ApplicationInsights.config:

<Add Type="Microsoft.ApplicationInsights.Web.OperationCorrelationTelemetryInitializer, Microsoft.AI.Web" />

This initializer has functionality, that is overlapping with Application Insights OWIN extensions. In contrast to OWIN extensions, it does utilize the ParentId property. As a result of combining those two, ParentId has different value than OperationId and RequestId. This is why the exception is not linked to the request.

Also a hint: you can still view exceptions, that are thrown within a request by selecting the All available telemetry for this operation option on the request in the portal.

@marcinbudny marcinbudny added question and removed bug labels Apr 29, 2017
@ursenzler
Copy link
Author

Thank you very much. That solved the problem.

Maybe you should add OperationCorrelationTelemetryInitializer to the list of things to remove in the readme.md. It was there after installing AppInsights within VS2017.

@marcinbudny
Copy link
Owner

Good idea, will do that. The docs were created before AI tools started adding this initializer.

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

No branches or pull requests

2 participants