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

Unwanted Traces #5604

Closed
liiamjones opened this issue May 10, 2024 · 1 comment
Closed

Unwanted Traces #5604

liiamjones opened this issue May 10, 2024 · 1 comment
Labels
question Further information is requested

Comments

@liiamjones
Copy link

What is the question?

How can i stop sending all these traces on every aspnet request. Before with App Insights SDK, these didn't appear.

Screenshot 2024-05-10 at 14 28 43

Additional context

This is my otel config

services.AddOpenTelemetry()
            .ConfigureResource(rb =>
                rb.AddService(DiagnosticsConfig.SourceName))
            .WithTracing(tpb =>
            {
                tpb.AddAspNetCoreInstrumentation(opt =>
                {
                    opt.EnrichWithHttpRequest = (activity, httpRequest) =>
                    {
                        activity.SetTag(DiagnosticsNames.Attributes.ClientProductCode, httpRequest.Headers["ProductCode"]);
                        activity.SetTag(DiagnosticsNames.Attributes.ClientProductVersion, httpRequest.Headers["ProductVersion"]);
                    };
                    opt.EnrichWithHttpResponse = (activity, response) =>
                    {
                        activity.SetTag(DiagnosticsNames.Attributes.EndUserId,
                            response.HttpContext.User.Identity?.Name);
                    };
                });
                tpb.AddSource(DiagnosticsConfig.SourceName);

            })
            .UseAzureMonitor(amo =>
            {
                amo.ConnectionString = m_Settings.GetAppSetting(Setting.Licensing.ApplicationInsightsConnectionString);
                amo.SamplingRatio = 0.05F;
            });
@liiamjones liiamjones added the question Further information is requested label May 10, 2024
@cijothomas
Copy link
Member

For issues related to UseAzureMonitor please report it in Azure Monitor repo. It looks like some ILogger logs getting captured as Traces, but it is best asked in AzureMonitor repo.

Feel free to reopen if you are having the issue of unwanted traces outside of using UseAzureMonitor. Please share a minimal repro when reopening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants