-
Notifications
You must be signed in to change notification settings - Fork 61
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
RequestId is not matching #6
Comments
Note: I implemented my project in .NET 5. That might be the culprit for missing properties in log, but the rest of the questions remain valid I think. |
You may be on to something, but I'll review as soon as I can. Will likely be this weekend when I have a chance to look more in depth. |
Ugh. I don't know where it went, but I wrote up a pretty big comment/solution to this and am 95% certain I submitted it. Most likely the 5% chance is what really happened, so I'll try to remember/paraphrase. This article explains how HttpContext is often used incorrectly. For whatever reason (I can't remember if I figured out and have forgotten now or not), new-ing up a Startup:
StandardHttpMessageHandler (just showing constructor which is only thing that changed)
BookList PageModel
No 'API Error ID' Implementation Since I was able to get Startup:
EnsureSuccessStatusCodeHandler (simply calls EnsureSuccessStatusCode which throws if not success):
And to fix issue with .NET 5 not logging SpanId, TraceId, ParentId
Configuring SeriLog:
ActivityEnricher
I'm pretty sure this is all that is needed to |
This looks like an awesome solution and I remember the HttpClient tickling the back of my neck a bit. If think the changes you are making would be compatible even with .net core 3.1 -- would you mind submitting them in a PR? I'd be happy to review / merge the changes -- it sounds like they are just what is needed and a better solution than what I was originally doing. |
When I run this repo and generate an error from the Book.API, I get an error page like this:
The request ID is |574e8e13-4e9d31fed64d4793.
When I look at the log entry in the file, I see:
So it appears to be matching the
SpanId
instead of theRequestId
.So my questions:
RequestId
properly on the error page vs theSpanId
. How is that possible?SpanId
's match across WebApi and Website calls (i.e. the two logs above, the top one is Web API and second one is Web Site)?The text was updated successfully, but these errors were encountered: