Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

Consider including a way to override the IHttpRequestIdentifierFeature implementation #2153

@robbieknuth

Description

@robbieknuth

It would be easiest to use Kestrel's identifier, but we already have a well formatted request identifier, so changing to a new format isn't an option. Setting the trace identifier on the HttpContext isn't particularly helpful for logging because the request start scope was started before any middleware is called, so all logs use the traceidentifer set by Kestrel. We have to wrap our requests with a using and a logging scope to get the correlation we need. This doesn't always work, though, if there are errors before that part of the pipeline is reached.

I've not been able to figure out how to tell Kestrel to use a different implementation. It's possible that I'm missing something obvious but I've looked through the code for a while and tried a bunch of different things, no dice.

I would prefer not to fork and hack it. I think this feature would be generally useful, it can probably be done in a way that doesn't impacg perf, as the existing implementation is already pay-to-play.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions