Closed RehanSaeed closed 4 years ago
Hi @RehanSaeed! I've been considering extra properties with the library. I had in mind something similar in terms of a "CallerIdentifier". I'm currently trying to decide how I'd prefer to do that. My thought at this point is maybe allowing a header with keys and values which can then be held on the context. This has it's pros and cons though.
I'll mark this under consideration as I'd like to do something around this in v3.0.
I was thinking that User-Agent
is common enough to warrant a property, as opposed to a dictionary entry.
A dictionary might be a good idea, what other HTTP headers do you envisage you'd want to add to the context? X-Tenant-ID
for multi-tenant apps might be an example.
Yeah I can imagine cases where business might want to pass more data along to downstream systems, as you say tenant id is an example. I was also thinking about thinks like a version number as well.
User-Agent might warrant it's own option for ease of use.
BTW User-Agent
can also contain an app version number.
@RehanSaeed - Finally getting around to some work on 3.0.0 features. I've kinda forgotten where my head was at with this issue. On reflection, I'm not entirely sure it's that useful to add since you can grab the UA from the HttpContext if needed.
Currently investigating open telemetry. I think there is a lot of overlap with this project and some of it has already been implemented in ASP.NET Core. See https://devblogs.microsoft.com/aspnet/improvements-in-net-core-3-0-for-troubleshooting-and-monitoring-distributed-apps/.
Yep agree that's better suited to more complex distributed tracing. I'll close this off and limit this library to a small feature set for those still wanting something simple for just passing correlation IDs around.
In my own home grown library I'm handling
X-Request-ID
but alsoUser-Agent
, so I know which app is making a call to my API. I also reflect the User-Agent back to the app much like we both do with the request ID but I don't really need to do that.I'm plugging both
X-Request-ID
andUser-Agent
into Serilog, so all of my logs have these properties.