Repository navigation
Support Activity.Current Changed Event - #67938
Conversation
|
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
|
Tagging subscribers to this area: @dotnet/area-system-diagnostics-activity Issue DetailsFixes #67276
|
| { | ||
| Activity? previous = s_current.Value; | ||
| s_current.Value = activity; | ||
| CurrentChanged?.Invoke(null, new ActivityChangedEventArgs(previous, activity)); |
There was a problem hiding this comment.
This means that arbitrary user code is now going to run anywhere Activity.Current is set. Is that always going to be ok? e.g. might that ever be set while holding a lock?
There was a problem hiding this comment.
It is possible there will be a lock held so it isn't foolproof, but its roughly the same type of problem that people already deal with successfully in ActivityListener. The small set of telemetry libraries that hook up to these mechanisms need to be careful to keep their dependencies limited both to avoid creating functional or performance problems.
|
Thanks @tarekgh! |
|
Regression dotnet/perf-autofiling-issues#5202 @tarekgh is it expected? |
Fixes #67276