C
C#3mo ago
Esa

HttpContext and TraceIdentifier

Anybody familiar with how the TraceId of HttpContext works? I am aware it represents a {TraceIdentifier}:{Span} format with the former being the overall identifier of an Activity and the latter being a specific sub-operation performed in the context of that activity. But I don't understand when one activity starts and another one stops. I tried performing multiple repeat API requests through swagger, and they all got the same TraceIdentifier but incrementing Spans. Can anyone clarify what is happening? I have a common .net 8.0 setup of program.cs for a WebAPI solution.
2 Replies
D3ullist
D3ullist3mo ago
It's based of the TraceHeader. You might wanna take a look at this post: https://stackoverflow.com/a/75759643 The post is based on .net7, but the same keeps up in .net8
Esa
Esa3mo ago
These aren't the values I'm seeing though, they're formatted a bit differently 0HN23C2AH7EDL:00000006 This is the type of format i see
Want results from more Discord servers?
Add your server
More Posts