Skip to content
This repository has been archived by the owner on Jun 10, 2020. It is now read-only.

Access to operation id #504

Closed
rosieks opened this issue Jul 27, 2017 · 3 comments
Closed

Access to operation id #504

rosieks opened this issue Jul 27, 2017 · 3 comments
Labels

Comments

@rosieks
Copy link

rosieks commented Jul 27, 2017

Please provide easy to use way to access Operation Id. I would like to create page or exception handler that will expose that ID to the user so he will be able to use it to contact the support.

@SergeyKanzhelev
Copy link
Contributor

Something like this will give you ID of a currently running request: httpContext.GetFeature<RequestTelemetry>().Context.Operation.Id

@lmolkova
Copy link
Member

lmolkova commented Jul 27, 2017

If you are using SDK version 2.1+ you can also use System.Diagnostics.Activity.Current?.RootId.

Showing Activity.Current.Id is the default behavior in ASP.NET Core 2.0 in VS 2017 (Preview 3) Razor page template. dotnet/templating#728

@rosieks
Copy link
Author

rosieks commented Jul 27, 2017

Thanks, that what I needed.

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

No branches or pull requests

3 participants