You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
✅ The description field contains the HTTP method and the full URL of the request (e.g., "GET http://my.service.io/some-data").
❌ If the request is to a relative URL (e.g., "GET /data.json"), the server.address span data value should be set to the server address (e.g., "my.service.io").
✅ The http.response.status_code contains the HTTP response status code (e.g., "200").
We appear to store this as "Extra" data rather than in the structured contexts, but the spans still show on the Requests page in Sentry
✅ If the request is to a relative URL (e.g., "GET /data.json"), the server.address span data value should be set to the server address (e.g., "my.service.io").
✅ The http.response.status_code contains the HTTP response status code (e.g., "200").
The text was updated successfully, but these errors were encountered:
So it turns out this scenario isn't actually possible in .NET:
❌ If the request is to a relative URL (e.g., "GET /data.json"), the server.address span data value should be set to the server address (e.g., "my.service.io").
The only way to use Relative URLs with HttpClient is like this:
The call to await client.GetAsync(uri) will throw an exception if you're using a Uri with UriKind.Relative and you haven't set the HttpClient.BaseAddress. On the other hand, if you provide the base address, this gets combined with the relative url to create an absolute Uri.
No matter which way you do it then, by the time we see the Uri in the SentryMessageHandler, it will be an absolute URI.
I've opted to always set the server.address span data, which I think is what's happening when the spans are instrumented with OpenTelemetry.
https://docs.sentry.io/product/performance/requests/#span-eligibility
Review
SentryHttpMessageHandler / SentryGraphQLHttpMessageHandler
We appear to store this as "Extra" data rather than in the structured contexts, but the spans still show on the Requests page in Sentry
sentry-dotnet/src/Sentry/SentryHttpMessageHandler.cs
Line 70 in 24c159f
sentry-dotnet/src/Sentry/SentryGraphQLHttpMessageHandler.cs
Line 57 in bf4e0b3
OpenTelemetry instrumentation
http.client
Microsoft.AspNetCore.Hosting.HttpRequestIn
sentry-dotnet/src/Sentry.OpenTelemetry/SentrySpanProcessor.cs
Line 344 in af2dd72
The text was updated successfully, but these errors were encountered: