getsentry / sentry-dotnet

Sentry SDK for .NET
https://docs.sentry.io/platforms/dotnet
MIT License
603 stars 206 forks source link

Add Distributed Tracing to the ASP.NET Core Documentation #2970

Open jamescrosswell opened 11 months ago

jamescrosswell commented 11 months ago

The Laravel docs have a section on Distributed Tracing that explains what people need to do in the front end of their app to pass a propagation id through to the back end and trace between processes.

We should add something similar explaining what to do in a Razor template or something to the ASP.NET Core docs.

Originally raised on Discord.

bruno-garcia commented 11 months ago

Added this one more generically on the docs repo (as it's not just about .NET): https://github.com/getsentry/sentry-docs/issues/8715

petefox commented 4 months ago

I can't believe I just came across this after two days of trying to figure out why this isn't working in asp.net core.

jamescrosswell commented 3 months ago

@bruno-garcia just checking what we're supposed to be doing here:

In ASP.NET, there are quite a few different options for how you build your UI. There are Razor Pages in ASP.NET MVC, there are all the different modes for Blazor (Server/Client/Hybrid) and then there are SPAs.

It looks like the technique described in the Laravel docs would mostly be relevant if you had a SPA hooked up to your ASP.NET application right? I think that's the only scenario in which people are likely to be instrumenting the front end using Sentry's javascript integration.

I don't think we have any helper functions (yet) in .NET to generate those meta tags. We could create some and then document how these could be used in conjunction with a SPA application that was instrumented using Sentry. Is that what we're talking about here?

jamescrosswell commented 3 months ago

A related question: what's the best way for users of the .NET SDK to include instrumentation for their front end when they're not using a SPA? Ideally a transaction would start when a request was made from the front end to the back end right? That might be done using AJAX, SignalR (or something else for WASM maybe)? Do we have a mechanism to automatically instrument those requests starting with the request from the front end? It looks like we only instrument the middleware at the moment.

bruno-garcia commented 1 month ago

cc @smeubank @mydea for guidance here. How do we document this?