Skip to content

Conversation

@jamescrosswell
Copy link
Collaborator

DESCRIBE YOUR PR

Resolves getsentry/sentry-dotnet#4670

IS YOUR CHANGE URGENT?

  • None: Not urgent, can wait up to 1 week+

SLA

cc: @Flash0ver

PRE-MERGE CHECKLIST

Make sure you've checked the following before merging your changes:

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

@vercel
Copy link

vercel bot commented Nov 3, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
develop-docs Ready Ready Preview Comment Nov 6, 2025 9:39pm
sentry-docs Ready Ready Preview Comment Nov 6, 2025 9:39pm

@codecov
Copy link

codecov bot commented Nov 3, 2025

Bundle Report

Changes will decrease total bundle size by 13.22kB (-0.06%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sentry-docs-client-array-push 10.16MB -6 bytes (-0.0%) ⬇️
sentry-docs-server-cjs 12.92MB -13.21kB (-0.1%) ⬇️

Affected Assets, Files, and Routes:

view changes for bundle: sentry-docs-client-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
static/chunks/pages/_app-*.js -3 bytes 882.71kB -0.0%
static/chunks/8321-*.js -3 bytes 425.87kB -0.0%
static/Zmgpq-*.js (New) 77 bytes 77 bytes 100.0% 🚀
static/Zmgpq-*.js (New) 684 bytes 684 bytes 100.0% 🚀
static/vgAVzbITWufmZ_YvgQqr2/_buildManifest.js (Deleted) -684 bytes 0 bytes -100.0% 🗑️
static/vgAVzbITWufmZ_YvgQqr2/_ssgManifest.js (Deleted) -77 bytes 0 bytes -100.0% 🗑️
view changes for bundle: sentry-docs-server-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
1729.js -3 bytes 1.74MB -0.0%
../instrumentation.js -3 bytes 1.07MB -0.0%
9523.js -3 bytes 1.04MB -0.0%
../app/[[...path]]/page.js.nft.json -4.4kB 872.44kB -0.5%
../app/platform-redirect/page.js.nft.json -4.4kB 872.36kB -0.5%
../app/sitemap.xml/route.js.nft.json -4.4kB 869.59kB -0.5%

@ericsampson
Copy link

What's the correct way to still use the SentryHttpFailedRequestHandler in this situation?

@jamescrosswell
Copy link
Collaborator Author

What's the correct way to still use the SentryHttpFailedRequestHandler in this situation?

@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 SentryHttpMessageHandler.

@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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add AddHttpClientInstrumentation and DisableSentryHttpMessageHandler to OTEL docs

4 participants