Skip to content
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

Correlation ID Context #1

Closed
stevejgordon opened this issue May 24, 2017 · 4 comments
Closed

Correlation ID Context #1

stevejgordon opened this issue May 24, 2017 · 4 comments
Assignees

Comments

@stevejgordon
Copy link
Owner

Currently the correlation ID is only exposed via the existing HttpContext.TraceIdentifier. This requires either access to the HttpContext or an IHttpContextAccessor to be able to get to the correlation ID.

I'm considering creating a custom "CorrelationContext" which will be available through DI so that the correlation ID can be more easily exposed in classes that don't already have easy access to HttpContext.

@stevejgordon stevejgordon added this to the vNext milestone May 24, 2017
@stevejgordon stevejgordon self-assigned this May 24, 2017
@glaxaco
Copy link

glaxaco commented Aug 3, 2017

I accomplished essentially the same thing by passing in a simple Func argument to the constructor of the class that is the client to another API to which I wanted to pass the correlation ID. That function is then passed in startup; the implementation is simply httpContextAccessor.HttpContext.TraceIdentifier.

@Franklin89
Copy link

@stevejgordon Do you have any time to implement this at some point soon?

@stevejgordon
Copy link
Owner Author

@Franklin89 Still thinking about it, just haven't had the time as yet.

@stevejgordon
Copy link
Owner Author

This work is completed and available since v2.0.0 https://github.com/stevejgordon/CorrelationId/releases/tag/rel%2F2.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants