[bug] ApplicationInsightsExporter SamplingRatio overwrites OTel Tracer Sampling Ratio #5830
Labels
needs-spec-change
Issues which require the OpenTelemetry Specification to clarify or define behavior
pkg:OpenTelemetry
Issues related to OpenTelemetry NuGet package
Package
OpenTelemetry
Package Version
Runtime Version
net6.0, net8.0
Description
The static class TracerProviderBuilderExtensions, contains a method called
SetSampler
which takes an instance ofTracerProviderBuilder
and calls TracerProviderBuilderSdk.SetSampler to set itssampler
instance to the providedsampler
.The issue is that since the builder is a a static instance. When adding the ApplicationInsightsExporter it also calls the very same
SetSampler
which can be seen here.This results in the overriding of the original sampling instance.
Steps to Reproduce
Expected Result
The original sampler instance should not be overridden when ApplicationInsightsSampler is added.
Actual Result
The original sampler instance is overridden by the ApplicationInsightsSampler.
Additional Context
No response
The text was updated successfully, but these errors were encountered: