-
Notifications
You must be signed in to change notification settings - Fork 296
Restore OTEL_SDK_DISABLED in AzureMonitorExporterOptions callbacks #3157
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -98,7 +98,7 @@ | |||||||||||
| .WithApplicationInsights() | ||||||||||||
| .UseApplicationInsightsTelemetry(); | ||||||||||||
|
|
||||||||||||
| AddTelemetryConfigAndClient(services, VersionUtils.ExtensionLabelShimWorkerService + VersionUtils.GetVersion(typeof(ApplicationInsightsExtensions))); | ||||||||||||
|
Check warning on line 101 in NETCORE/src/Microsoft.ApplicationInsights.WorkerService/ApplicationInsightsExtensions.cs
|
||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| return services; | ||||||||||||
|
|
@@ -200,6 +200,12 @@ | |||||||||||
| { | ||||||||||||
| var serviceOptions = aiOptions.Value; | ||||||||||||
|
|
||||||||||||
| // Set OTEL_SDK_DISABLED in configuration if DisableTelemetry is true | ||||||||||||
| if (telemetryConfig.DisableTelemetry) | ||||||||||||
| { | ||||||||||||
| config["OTEL_SDK_DISABLED"] = "true"; | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
|
Comment on lines
+203
to
+208
|
||||||||||||
| // Set OTEL_SDK_DISABLED in configuration if DisableTelemetry is true | |
| if (telemetryConfig.DisableTelemetry) | |
| { | |
| config["OTEL_SDK_DISABLED"] = "true"; | |
| } |
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.
Intentionally keeping this as defense-in-depth. The TelemetryConfiguration factory covers MeterProvider, but TracerProvider may resolve through a different path. Setting the same value twice in IConfiguration is harmless and this was the original behavior on main before #3156.
Uh oh!
There was an error while loading. Please reload this page.