-
Notifications
You must be signed in to change notification settings - Fork 769
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc(propagators): switch to use new Extensions.Propagators package, a…
…dd some documentation (#3271)
- Loading branch information
Showing
5 changed files
with
58 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Changelog | ||
|
||
## Unreleased | ||
|
||
* Initial release. This has been ported as is from | ||
[OpenTelemetry.Api](../OpenTelemetry.Api/README.md) package. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Propagator formats for OpenTelemetry .NET | ||
|
||
[![NuGet](https://img.shields.io/nuget/v/OpenTelemetry.Extensions.Propagators.svg)](https://www.nuget.org/packages/OpenTelemetry.Extensions.Propagators) | ||
[![NuGet](https://img.shields.io/nuget/dt/OpenTelemetry.Extensions.Propagators.svg)](https://www.nuget.org/packages/OpenTelemetry.Extensions.Propagators) | ||
|
||
The package provides context | ||
propagators by following the [OpenTelemetry specification](https://opentelemetry.io/docs/reference/specification/context/api-propagators/) | ||
(currently supporting [B3](https://github.com/openzipkin/b3-propagation) format) | ||
for tracing. | ||
|
||
## Installation | ||
|
||
Add a reference to the | ||
[`OpenTelemetry.Extensions.Propagators`](https://www.nuget.org/packages/OpenTelemetry.Extensions.Propagators) | ||
package in your project. | ||
|
||
```shell | ||
dotnet add package --prerelease OpenTelemetry.Extensions.Propagators | ||
``` | ||
|
||
## Configuration | ||
|
||
Use `B3 OpenZipkin` context only: | ||
|
||
```csharp | ||
using OpenTelemetry; | ||
using OpenTelemetry.Extensions.Propagators; | ||
|
||
Sdk.SetDefaultTextMapPropagator(new B3Propagator()) | ||
``` | ||
|
||
Use `B3 OpenZipkin` and `W3C Baggage` propagators at the same time: | ||
|
||
```csharp | ||
using OpenTelemetry; | ||
using OpenTelemetry.Context.Propagation; | ||
using OpenTelemetry.Extensions.Propagators; | ||
|
||
Sdk.SetDefaultTextMapPropagator(new CompositeTextMapPropagator(new TextMapPropagator[] | ||
{ | ||
new OpenTelemetry.Extensions.Propagators.B3Propagator(), | ||
new BaggagePropagator(), | ||
})); | ||
``` | ||
|
||
## References | ||
|
||
* [B3 (Zipkin) Context specification](https://github.com/openzipkin/b3-propagation) | ||
* [OpenTelemetry Project](https://opentelemetry.io/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters