-
Notifications
You must be signed in to change notification settings - Fork 38
Add activity source to allow OpenTelemetry to collect tracing #645
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zhiyuanliang-ms
commented
Apr 13, 2025
...icrosoft.Extensions.Configuration.AzureAppConfiguration/Constants/RequestTracingConstants.cs
Outdated
Show resolved
Hide resolved
zhiyuanliang-ms
commented
Apr 15, 2025
src/Microsoft.Extensions.Configuration.AzureAppConfiguration/AzureAppConfigurationOptions.cs
Outdated
Show resolved
Hide resolved
18 tasks
zhiyuanliang-ms
commented
Apr 15, 2025
src/Microsoft.Extensions.Configuration.AzureAppConfiguration/AzureAppConfigurationProvider.cs
Outdated
Show resolved
Hide resolved
8d81c4c
to
934f825
Compare
934f825
to
66bd907
Compare
…etProvider into zhiyuanliang/activity-source
This reverts commit 59d847a.
jimmyca15
reviewed
Apr 22, 2025
src/Microsoft.Extensions.Configuration.AzureAppConfiguration/Constants/ActivityConstants.cs
Outdated
Show resolved
Hide resolved
jimmyca15
reviewed
Apr 22, 2025
src/Microsoft.Extensions.Configuration.AzureAppConfiguration/AzureAppConfigurationProvider.cs
Outdated
Show resolved
Hide resolved
jimmyca15
reviewed
Apr 22, 2025
src/Microsoft.Extensions.Configuration.AzureAppConfiguration/AzureAppConfigurationProvider.cs
Show resolved
Hide resolved
jimmyca15
reviewed
Apr 22, 2025
src/Microsoft.Extensions.Configuration.AzureAppConfiguration/AzureAppConfigurationProvider.cs
Show resolved
Hide resolved
jimmyca15
approved these changes
Apr 22, 2025
jimmyca15
approved these changes
Apr 23, 2025
This was referenced Jul 23, 2025
Closed
Closed
This was referenced Aug 1, 2025
Open
Open
This was referenced Aug 16, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why this PR?
OpenTelemetry tracing in .NET is built on
Activity
.Only
Activity
fromActivitySource
which is registered toTracerProvider
byAddSource
method will be traced by OpenTelemetry. (Implementation details: TracerProviderSdk OTEL will create activity listener to trace activities.)This PR adds an
ActivitySource
with name called"Microsoft.Extensions.Configuration.AzureAppConfiguration"
to allow OpenTelemetry to collect tracing for theLoad
andRefresh
activities.Bug fixes
Activity created by the .NET SDK(
ConfigurationClient
) cannot be traced because of the request tracing in .NET provider which is built on "CustomDiagnosticsHeaders" activity.Below are the implementation details of the request tracing in .NET SDK and .NET provider:
Request tracing hook: SDK, provider
The .NET provider will start a new Activity with no source/listener. This activity will have
ActivityTraceFlags
set toActivityTraceFlags.None
. According to doc, this kind of activity will not be traced. And the activity created by theConfigurationClient
from SDK will be the child activity of the activity we created and it will inherit theActivityTraceFlags
which will cause the child activity not to be traced.The below code demostrates the issue in a simplified way:
Verify that request tracing can work with the change in this PR
Currently, we are lacking testcases about request tracing in this repo.
The following code can be used to verify that the request tracing won't be effected. (OpenTelemetry.Extensions.Hosting and OpenTelemetry.Exporter.InMemory packages are required)