dotnet / dotnet/docs

Distributed tracing with links has wrong signature

Open
#28,903 0 comments 0 reactions 0 assignees View on GitHub
dotnet-fundamentals/svc okr-quality
Dominant language
No language data
Stars
4.8k
Forks
6.1k
Avg merge
19h 10m
Merged PRs (30d)
268

Description

Hey there, I was checking on how to add links to distributed tracing and found out this [1] part which sets `parentContext` as null but, there is no signature in `StartActivity` where `parentContext` is optional, did I miss something?
Trying the following will return an error:
```csharp
_activitySource.StartActivity(ActivityKind.Consumer, parentContext: null);
```
```
Argument type 'null' is not assignable to parameter type 'System.Diagnostics.ActivityContext'
```

[1] https://docs.microsoft.com/en-us/dotnet/core/diagnostics/distributed-tracing-instrumentation-walkthroughs#optional-links

---
#### Document Details

⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*

* ID: 3f30f3b0-90cb-d2eb-ee08-4319ffcb7686
* Version Independent ID: dc4689df-b03a-e744-dbed-f23d8defcb6e
* Content: [Add distributed tracing instrumentation - .NET](https://docs.microsoft.com/en-us/dotnet/core/diagnostics/distributed-tracing-instrumentation-walkthroughs)
* Content Source: [docs/core/diagnostics/distributed-tracing-instrumentation-walkthroughs.md](https://github.com/dotnet/docs/blob/main/docs/core/diagnostics/distributed-tracing-instrumentation-walkthroughs.md)
* Product: **dotnet-fundamentals**
* GitHub Login: @tommcdon
* Microsoft Alias: **tommcdon**

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.