Skip to content
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

[BUG] AddAzureMonitorTraceExporter ignores sampling #47780

Open
bklooste opened this issue Jan 10, 2025 · 0 comments
Open

[BUG] AddAzureMonitorTraceExporter ignores sampling #47780

bklooste opened this issue Jan 10, 2025 · 0 comments
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@bklooste
Copy link

Library name and version

Azure.Monitor.OpenTelemtry.Exporter 1.3

Describe the bug

As we are getting more into open telemtry and trying to cut our logging costs we noted that sampling is broken

eg for http we want the sampling to be based on the span header however for EventHubs and Redis where there is no span we want to use TraceIdRatioBasedSampler

AddAzureMonitorTraceExporter ignores changes this. How do we do this ?

Expected behavior

The actual sampler is used

Actual behavior

The sampler is ignored

Reproduction Steps

var traceBuilder2 = Sdk.CreateTracerProviderBuilder()
               .SetResourceBuilder(resourceBuilder)
               .SetSampler(new TraceIdRatioBasedSampler(0.02))
               .AddAzureMonitorTraceExporter(options =>
               {
                   options.ConnectionString = connString;
                   options.SamplingRatio = 0.05f;
               })
           .AddRedisInstrumentation(redisCon, options => options.EnrichActivityWithTimingEvents = false)

Environment

No response

@github-actions github-actions bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

1 participant