-
Notifications
You must be signed in to change notification settings - Fork 358
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
Correlation stopped working, dependency telemetry is no longer child to request (and where did Legacy Operation Id come from?) #2302
Comments
What version of WebJobs (and the AppInsights nuget) are you using? How are you accessing the TelemetryClient from your function? |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. |
I'm using I'm injecting the TelemetryClient in the ctor: public LogDependency(TelemetryClient telemetryClient, ILoggerFactory loggerFactory) I took a sneak peak with var telemetryClients = host.Services.GetServices<Microsoft.ApplicationInsights.TelemetryClient>(); to see if there where more than one telemetry client registered but there is only one registered. |
I see a variation on this, RequestTelemetry (WebJob-execution) and DependencyTelemetry and TraceTelemetry match each other, but value sent in "Request-ID" header with HttpClient to backend systems doesn't! Why don't we get same behavior as e.g. in a ASP.NET Core webapp, where they are all aligned and no use for a "ai_legacyRequestId"? I'm using |
I just created a new webjob as a .ConfigureLogging((hostingContext, loggingBuilder) =>
{
loggingBuilder.AddApplicationInsightsWebJobs();
}) <PackageReference Include="Microsoft.Azure.WebJobs" Version="3.0.14" />
<PackageReference Include="Microsoft.Azure.WebJobs.Logging.ApplicationInsights" Version="3.0.14" /> |
I'm not sure if it's supposed to be like this or not but the |
@lmolkova should be able to comment on the correlation questions. |
Legacy request id is expected as a part of the transition to the new W3C Trace-Context standard for correlation. This is internal (and undocumented) AppInsights property that UX uses to stitch together old and new correlation-ids formats and allow backward compatibility with older applications. @OskarKlintrot it seems you are hitting SQL correlation bug we introduced (and fixed) in AppInsights SDK microsoft/ApplicationInsights-dotnet-server#1277. If you use pure WebJobs, you may fix it with installing the latest stable version 2.8.2 of AppInsights for ASP.NET Core If you are using Functions, I don't think it will help. @brettsam, can you remind if Functions allow newer versions of AppInsights? I'll send PR to pick up the latest patched AppInsights SDK from WebJobs/Functions. |
Thanks @lmolkova, using version 2.8.2 of |
I get this strange behavior where the correlation of a WebJob-execution (
RequestTelemetry
) do not align correctly with theDependencyTelemetry
. Looking at the properties it looks likeLegacy Operation Id
andLegacy Id
makes more sense thanOperation Id
andRequest/Dependency Id
. However nowhere theDependencyTelemetry
seem to have theRequestTelemetry
as parent. I log the dependency telemetry manually withTelemetryClient
(to be able to log the request and response body, I use a processor to get rid of the auto-logged since I do want to log other dependencies, if there would be any). There is just one registeredTelemetryClient
and one registeredTelemetryConfiguration
so that looks all fine to me. Not sure where to even start looking to solve this, any suggestions?The expected behavior is that the top most telemetry is parent to all of the telemetry below. The dependency calls are made one after the other, they are not nested as it looks in the timeline. Pay especially attention to the first dependency telemetry, in the timeline that one is actually logged as the last call but it's shown as the first anyway.
The text was updated successfully, but these errors were encountered: