#Is there a guide somewhere for tracing each request in C# web app?

26 messages · Page 1 of 1 (latest)

turbid carbon
#

I am trying to replace ApplicationInsights with Sentry in my Azure Functions Isoalted Worker app. I have dug through all the docs and examples and cannot find an answer to this.
In ApplicationInsights, I saw every request coming through and the flow of the code in those requests, such as outbound calls the server made.

How can I acehive the same thing in Sentry? It seems I have to use tracing/transactions, but I am not sure how? Is there a documentation describing this?
thanks!!

hushed rock
#

Hey @turbid carbon, can you help me understand what you're trying to achieve?
What do you mean with saw every request coming thorugh an the flow of the code?
When setting the TracesSampleRate to something >0 the SDK will automatically attempt to get the sentryTraceHeader from the incoming request, attempting to connect the request with your worker instance.

turbid carbon
#

hey @hushed rock thanks for the reply. I have the tracing and profiling enabled, where can I see all requests made to the azure function app in the Sentry UI? here is my settings { "Sentry": "SNIPPED", "Debug": true, "TracesSampleRate": 1.0, "ProfilesSampleRate": 1.0 }, "Logging": { "LogLevel": { "Default": "Debug" } } }

#

also, is there somewhere I can see all logs I am writing? For example,, I use a logger to log Info, Debug etc logs. Where can I just see all those and search them?

lavish glade
#

@turbid carbon Sentry isn't a log management solution. Breadcrumbs and exceptions can be created automatically for logs using one of the logging integrations (e.g. MEL) but it won't record or let you search for all logs.

Regarding traces, the above configuration looks OK (it should capture 100% of the traces) assuming you're also supplying a DSN somewhere (e.g. via code when initialising the Sentry SDK). How are you initialising the SDK?

turbid carbon
#

So Sentry is really just designed for errors?

#

About my config, yes, I have a DSN and can see errors in "Issues" section, but I don't see anytthing in "Traces" section. Where in the UI of Sentry.io can I see these request logs?

#

I am already using MEL and I do see the breadcrums working automatically for logs

#

I have Traces and PRofiles set to 1.0:

#

my appsettings.config is this:

#
  "Sentry": {
    "Dsn": "REDACTED",
    "Debug": true,
    "TracesSampleRate": 1.0,
    "ProfilesSampleRate": 1.0
  },
  "Logging": {
    "LogLevel": {
      "Default": "Debug"
    }
  },
  "applicationInsights": {
    "ConnectionString": "REDACTED",
    "LogLevel": {
      "Default": "Trace"
    },
    "enableLiveMetricsFilters": true
  }
}
lavish glade
lavish glade
#

btw @turbid carbon do you see anything in the performance dashboard in Sentry? The Traces dashboard was added relatively recently to Sentry. Historically the Performance dashboard is where you would go to see all the Sentry traces.

If you're seeing stuff in the Performance dashboard but not in the Traces dashboard, it'd be good to dig into your setup (SDK version etc.) to try to work out why.

turbid carbon
#

hey @lavish glade , yeah, I see stuff in Performance

#

Maybe it is working and I just need to learn the UI better

#

The Performance tab seems to be an aggregation of calls to requests

#

but I am looking for the thing that shows eavch individual request. Should that be available somewhere? traces tab doesnt seem to be it, it has some data, but when I make a request, it doesnt show up on there

#

If I start going to 2+ days out I see things on Traces, I have no idea why its like that

#

Is there a way to de-aggregate Performances and see individual requests?

lavish glade
#

@turbid carbon you should be able to navigate to traces either from the issues dashboard or from the performance dashboard.

In the case of issues, there's a TraceID that you can click on in the event highlights:

#

That would take you to the trace view for the event:

#

In the performance dashboard you can click on any transaction. From there you'll see a list of traces for that transaction group, each with it's own timestamp:

#

Again, from there you can click on the TraceID to go to the relevant trace for that transaction (which gives you a distributed view of what went on for that request across front/back end etc.):