Description
For the upcoming for ASP.Net Core 2.1; pull #1138 added to the log scope a CorrelationId
, but the contents are only the parent request identifier and does not appear to be set if there was no parent request (no Request-Id
header in the incoming HTTP request).
There is documentation/specifications (mostly by @lmolkova) around these terms at:
Specifically in the Activity User Guide, it says:
When application calls external dependency to complete an operation, it may need to pass some of the context (e.g. correlation id) [emphasis added] along with dependency call to be able to correlate logs from multiple service.
I see that the expectation is that in the logs, there will be a "correlation id" of the context, or CorrelationId
if you will, that can be used to link the logs entries across multiple services handling a single user request.
In the current preview code, the Log scope outputs a CorrelationId
which is the value of an incoming header Request-Id
, and only if that header is set. This is not useful for seeing the entire request across multiple services in the logs. What is needed is adding to the log scope the root request id to the log scope of all services involved in handling the request, including within the root service that generated the first request id.