-
-
Notifications
You must be signed in to change notification settings - Fork 207
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
HTTP info not applies to local scope #2337
Comments
Thanks for reporting. I'll take a look soon. |
Thanks for the app sample. On further investigation, a smaller reproduction of the same bug is: using Sentry;
var builder = WebApplication.CreateBuilder(args);
builder.WebHost.UseSentry(dsn);
var app = builder.Build();
app.MapGet("/", () =>
{
SentrySdk.CaptureMessage("test", scope => { });
return "ok";
});
app.Run(); That will capture a message, but the HTTP request context is absent from the event. Remove the scope argument from the capture call, and it works fine. I believe I know what's causing this, and I should have a fix ready shortly. Thanks. |
FYI - It's not just the HTTP Request context, but rather anything that is added to the scope by the ASP.NET Core Middleware at this point: sentry-dotnet/src/Sentry.AspNetCore/SentryMiddleware.cs Lines 102 to 106 in 93c5fa8
That could be many things, depending on how the app is configured. There are two issues here:
|
Package
Sentry.AspNetCore
SDK Version
3.30.0
Steps to Reproduce
Description:
When trying to addBreadcrumbs to local scope, HTTP info/context is not applied to events unless you capture an event to the global scope prior to applying breadcrumbs to local scope. Test utilizing
UseSentry()
and attached repro app - MyWebApp.zipSteps to repro:
Expected Result
Issues to have HTTP context when addingBreadcrumbs to the local scope when initializing with UseSentry()
Actual Result
Only when adding the global scope first, is the HTTP context applied for local scope
The text was updated successfully, but these errors were encountered: