dotnet / dotnet/dotnet-api-docs

Documentation for ActivitySource.CreateActivity/StartActivity missing important information about behavior for default Context

Open
#7,834 6 comments 2 reactions 0 assignees View on GitHub
area-System.Diagnostics.Tracing Pri3
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

Regarding these documentation pages:
[https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.activitysource.createactivity](ActivitySource.CreateActivity)
[https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.activitysource.startactivity](ActivitySource.StartActivity)

When one of the following conditions are true:
- `parentContext` argument is `default`, or
- `parentId` argument is `default`, or
- method does not take either of those two arguments,

then the methods parent the new `Activity` to `Activity.Current`.

This is critical information. Discussion can be found in [this thread](https://github.com/dotnet/runtime/issues/65528#issuecomment-1068855998)

cc @tarekgh

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.