-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Added docs on avoiding duplicate HTTP spans when using OTEL #15378
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
base: master
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Bundle ReportChanges will decrease total bundle size by 13.22kB (-0.06%) ⬇️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: sentry-docs-client-array-pushAssets Changed:
view changes for bundle: sentry-docs-server-cjsAssets Changed:
|
|
What's the correct way to still use the |
@ericsampson you could disable the OTEL instrumentation for outbound HTTP requests.. so: var builder = WebApplication.CreateBuilder(args);
builder.Services.AddOpenTelemetry()
.WithTracing(tracerProviderBuilder =>
tracerProviderBuilder
.AddAspNetCoreInstrumentation() // <-- Adds ASP.NET Core telemetry sources
- .AddHttpClientInstrumentation() // <-- Adds HttpClient telemetry sources
.AddSentry() // <-- Configure OpenTelemetry to send trace information to Sentry
);
builder.WebHost.UseSentry(options =>
{
options.Dsn = "...Your DSN...";
options.SendDefaultPii = true;
options.TracesSampleRate = 1.0;
options.UseOpenTelemetry(); // <-- Configure Sentry to use OpenTelemetry trace information
- options.DisableSentryHttpMessageHandler = true; // <-- Disable Sentry's HttpClient instrumentation to avoid duplicate spans
});That way you still get features like failed request handling, that rely on the @Flash0ver we could look at changing this so it's possible to disable tracing for HTTP client requests without disabling the message handler entirely (and thus the error handling stuff). |
DESCRIBE YOUR PR
Resolves getsentry/sentry-dotnet#4670
IS YOUR CHANGE URGENT?
SLA
cc: @Flash0ver
PRE-MERGE CHECKLIST
Make sure you've checked the following before merging your changes: