-
Notifications
You must be signed in to change notification settings - Fork 273
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
Distributed Tracing #1270
Distributed Tracing #1270
Conversation
/AzurePipelines run |
Pull request contains merge conflicts. |
@amdeel Thank you for the trigger! I'm busy state until Monday, I'll fix the conflict after that, then ping you. |
6d25781
to
65bffc0
Compare
The test fails, we need to push DurableTaskCore.Telemetry package first. |
Ready for review and merge. However, the CI fails because:
Is there any good ways to run the appveyor CI under this situation? |
src/WebJobs.Extensions.DurableTask/Correlation/DurableTaskCorrelationTelemetryInitializer.cs
Outdated
Show resolved
Hide resolved
{ | ||
if (this.IsSuppressedTelemetry(telemetry)) | ||
{ | ||
this.SuppressTelemetry(telemetry); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would suppress the telemetry within the durable task.
Additional work is required to communicate back to the host and suppress the telemetry there:
- Durable task puts the suppression flag in the payload before returning back to the Functions host.
- Once Functions host received the suppression flag, respect the flag and stop emitting telemetry events (context propagation is still required).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @reyang
Thank you for the notice! Very good point.
This issue might be related.
#593
Maybe this TelemetryInitializer might be the one fix on the functions host side.
https://github.com/Azure/azure-webjobs-sdk/blob/dev/src/Microsoft.Azure.WebJobs.Logging.ApplicationInsights/Initializers/WebJobsTelemetryInitializer.cs
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
using DurableTask.Core.Settings; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not related to this PR though, the namespace seems to be against the naming convention.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean <Company>.<Technology>*
rule?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. Then it might be a problem of the DurableTask framework side. Thank you for pointing out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall, I've left my suggestions on how to make the experience work by suppressing telemetry events on both sides (durable function + functions host). I've also left some minor comments that are not specific about this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a lot of conditional compilation I want to see cleaned up before we merge this I think. I think only compiling your new files in non-Functions V1 will substantially simplify a lot of our conditional compilation.
As mentioned in one of the comments, we should discuss how we want to handle Functions V1 for this release while it is it's own package. I think we should actively discourage Functions V1 customers from using this alternative package, since they won't get any benefit from this.
That being said, it may be lest to leave the net461 bits in there. I think we use net461 vs netstandard2.0 to diferentiate features that are only available in Functions V2+, and if we get rid of net461 bits, then Functions V1 customers who avoid our recommendation and use the custom package will use the netstandard2.0 bits, which will likely break their app.
samples/correlation-csharp/FunctionAppCorrelation/local.settings.json
Outdated
Show resolved
Hide resolved
src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs
Outdated
Show resolved
Hide resolved
src/WebJobs.Extensions.DurableTask/Correlation/TraceContextBaseExtensions.cs
Outdated
Show resolved
Hide resolved
src/WebJobs.Extensions.DurableTask/Correlation/DurableTaskCorrelationTelemetryInitializer.cs
Outdated
Show resolved
Hide resolved
src/WebJobs.Extensions.DurableTask/Correlation/DurableTaskCorrelationTelemetryInitializer.cs
Outdated
Show resolved
Hide resolved
</ItemGroup> | ||
|
||
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'"> | ||
<PackageReference Include="Microsoft.Azure.WebJobs" Version="3.0.14" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Mvc.WebApiCompatShim" Version="2.2.0" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Mvc.WebApiCompatShim" Version="2.1.0" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I vaguely remember some weirdness here, where we had to use a specific version to avoid breaking a build. I'll see if I can dig up the issue.
src/WebJobs.Extensions.DurableTask/WebJobs.Extensions.DurableTask.csproj
Outdated
Show resolved
Hide resolved
/AzurePipelines run |
Commenter does not have sufficient privileges for PR 1270 in repo Azure/azure-functions-durable-extension |
I fix all of the issue that you point out! Could you run the AzDO pipeline? |
…to DistributedTracingEnabled
According to the request of renaming from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's getting very close. Mainly a few nits remaining!
I think we can merge this once you address this last round of feedback.
/// 2. Avoid to be overriden when it is RequestTelemetry | ||
/// Original Source is here https://github.com/microsoft/ApplicationInsights-dotnet-server/blob/2.8.0/Src/Common/W3C/W3COperationCorrelationTelemetryInitializer.cs. | ||
/// </summary> | ||
[Obsolete("Not ready for public consumption.")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason we are marking this as obsolete? In general, since this is internal, I don't see much benefit to this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you may want to mark the interface ITelemetryInitializer
with this attribute, as that is public. I wish it didn't have to be, but I haven't found a good way to have non-public interfaces be injected via dependency injection yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remove the Obsolute attribute. The reason it was there is, I took this code from https://github.com/microsoft/ApplicationInsights-dotnet-server/blob/2.8.0/Src/Common/W3C/W3COperationCorrelationTelemetryInitializer.cs as I leave the comment on it. After that I modify it. So the first time, I just keep the same structure, however, since I modify it, it means nothing. I removed it and remove warning suppression at the TelemetryActivator.
src/WebJobs.Extensions.DurableTask/Correlation/StringExtensions.cs
Outdated
Show resolved
Hide resolved
src/WebJobs.Extensions.DurableTask/Correlation/StringExtensions.cs
Outdated
Show resolved
Hide resolved
src/WebJobs.Extensions.DurableTask/Correlation/StringExtensions.cs
Outdated
Show resolved
Hide resolved
src/WebJobs.Extensions.DurableTask/Correlation/TraceContextBaseExtensions.cs
Outdated
Show resolved
Hide resolved
@ConnorMcMahon I've done the all fix. I appreciate your review! I learned a lot! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
The Distributed Tracing Implementation
I create this PR for share/review/discuss the architecture.
This branch includes references for non-published NuGet package (DurableTask correlation branch:https://github.com/Azure/durabletask/tree/correlation), so DO NOT MERGE
Also, I need to resolve conflict against the correlation branch.
Overview
Supported
Not Supported yet
TODO
Related Issue:
#939