1
1
[ ![ Pull Request Validation] ( https://github.com/elastic/elastic-otel-dotnet/actions/workflows/ci.yml/badge.svg )] ( https://github.com/elastic/elastic-otel-dotnet/actions/workflows/ci.yml )
2
2
3
- # Elastic OpenTelemetry .NET Distribution
3
+ # Elastic Distribution for OpenTelemetry .NET
4
4
5
- The Elastic OpenTelemetry .NET Distribution provides a zero code change extension
5
+ The Elastic Distribution for OpenTelemetry .NET provides a zero code change extension
6
6
to [ OpenTelemetry SDK for .NET] ( https://opentelemetry.io/docs/languages/net ) . These extensions ensure
7
7
a smooth and rich out of the box experience with [ Elastic Observability] ( https://www.elastic.co/observability )
8
8
through strictly OpenTelemetry native means.
9
9
10
10
This ensures there are no new concepts to learn with the full OpenTelemetry ecosystem remains at ones
11
11
fingertips. Read more about the concept of [ OpenTelemetry Distributions] ( https://opentelemetry.io/docs/concepts/distributions ) .
12
12
13
- The Elastic distribution includes some Elastic-specific processors to ensure the best
13
+ The Elastic Distribution for OpenTelemetry .NET includes some Elastic-specific processors to ensure the best
14
14
compatibility when exporting OpenTelemetry signal data [ Elastic Observability] ( https://www.elastic.co/observability ) .
15
15
The distribution also preconfigures the collection of tracing, metrics and logs signals, applying
16
16
some opinionated defaults, such as which sources are collected by default. The distribution also
17
17
ensures that the OTLP exporter is enabled by default.
18
18
19
- > ** _ IMPORTANT:_ ** The Elastic distribution is currently in early alpha release status. It is not yet feature
20
- complete and may contain bugs. We are actively working on improving the distribution and
19
+ > ** _ IMPORTANT:_ ** The Elastic Distribution for OpenTelemetry .NET is currently in early alpha release status.
20
+ > It is not yet feature complete and may contain bugs. We are actively working on improving the distribution and
21
21
adding new features.
22
22
>
23
23
> If you would like to experience the alpha and help us improve the distribution by providing
@@ -40,7 +40,7 @@ Before continuing, ensure that you have a supported
40
40
41
41
### Installation
42
42
43
- To get started with the Elastic OpenTelemetry .NET Distribution , you must add the
43
+ To get started with the Elastic Distribution for OpenTelemetry .NET, you must add the
44
44
[ ` Elastic.OpenTelemetry ` ] ( https://www.nuget.org/packages/Elastic.OpenTelemetry )
45
45
NuGet package to your project. This can be achieved by adding the package reference to your project file.
46
46
@@ -50,25 +50,25 @@ NuGet package to your project. This can be achieved by adding the package refere
50
50
> ** _ NOTE:_ ** Replace the ` <LATEST> ` placeholder with the latest available package from
51
51
[ NuGet.org] ( https://www.nuget.org/packages/Elastic.OpenTelemetry ) .
52
52
53
- After adding the package reference, you can start using the Elastic OpenTelemetry distribution
53
+ After adding the package reference, you can start using the Elastic Distribution for OpenTelemetry .NET
54
54
in your application. The distribution includes a transitive dependency on the OpenTelemetry SDK,
55
55
so you do not need to add the OpenTelemetry SDK package to your project, although doing so will
56
- cause no harm and may be used to opt into newer SDK versions before the Elastic distribution
56
+ cause no harm and may be used to opt into newer SDK versions before the Elastic Distribution for OpenTelemetry .NET
57
57
references them.
58
58
59
- The Elastic OpenTelemetry distribution is designed to be easy to use and integrate into your
59
+ The Elastic Distribution for OpenTelemetry .NET is designed to be easy to use and integrate into your
60
60
applications. This includes applications which have previously used the OpenTelemetry SDK directly.
61
61
In situations where the OpenTelemetry SDK is already used, the only required change is
62
62
to add the [ ` Elastic.OpenTelemetry ` ] ( https://www.nuget.org/packages/Elastic.OpenTelemetry ) NuGet
63
63
package to the project. Doing so will automatically switch to the opinionated configuration provided
64
- by the Elastic distribution .
64
+ by the Elastic Distribution for OpenTelemetry .NET .
65
65
66
66
### ASP.NET Core usage
67
67
68
68
A common requirement is to instrument ASP.NET Core applications based on the ` Microsoft.Extensions.Hosting `
69
69
libraries which provide dependency injection via an ` IServiceProvider ` .
70
70
71
- The OpenTelemetry SDK and the Elastic distribution provide extension methods to enable observability
71
+ The OpenTelemetry SDK and the Elastic Distribution for OpenTelemetry .NET provide extension methods to enable observability
72
72
features in your application by adding a few lines of code.
73
73
74
74
In this section, we'll focus on instrumenting an ASP.NET Core minimal API application using the Elastic
@@ -88,7 +88,7 @@ NuGet package to your project:
88
88
89
89
This package includes instrumentation to collect traces for requests handled by ASP.NET Core endpoints.
90
90
91
- > ** _ NOTE:_ ** The ASP.NET Core instrumentation is not included by default in the Elastic OpenTelemetry distribution .
91
+ > ** _ NOTE:_ ** The ASP.NET Core instrumentation is not included by default in the Elastic Distribution for OpenTelemetry .NET .
92
92
As with all optional instrumentation libraries, you can choose to include them in your application by
93
93
adding a suitable package reference.
94
94
@@ -100,7 +100,7 @@ using OpenTelemetry.Trace;
100
100
```
101
101
102
102
The OpenTelemetry SDK provides extension methods on the ` IServiceCollection ` to support enabling the
103
- providers and configuring the SDK. The Elastic distribution overrides the default SDK registration,
103
+ providers and configuring the SDK. The Elastic Distribution for OpenTelemetry .NET overrides the default SDK registration,
104
104
adding several opinionated defaults.
105
105
106
106
In the minimal API template, the ` WebApplicationBuilder ` exposes a ` Services ` property that can be used
@@ -120,12 +120,12 @@ injection container. This is NOT required to enable OpenTelemetry, but the examp
120
120
send an HTTP request.
121
121
122
122
<2> The ` AddOpenTelemetry ` method registers the OpenTelemetry SDK with the dependency injection
123
- container. When available, the Elastic distribution will override this to add opinionated defaults.
123
+ container. When available, the Elastic Distribution for OpenTelemetry .NET will override this to add opinionated defaults.
124
124
125
125
<3> Configure tracing to instrument requests handled by ASP.NET Core.
126
126
127
127
With these limited changes to the ` Program.cs ` file, the application is now configured to use the
128
- OpenTelemetry SDK and the Elastic distribution to collect traces and metrics, which are exported via
128
+ OpenTelemetry SDK and the Elastic Distribution for OpenTelemetry .NET to collect traces and metrics, which are exported via
129
129
OTLP.
130
130
131
131
To demonstrate the tracing capabilities, add a simple endpoint to the application:
@@ -144,7 +144,7 @@ app.MapGet("/", async (IHttpClientFactory httpClientFactory) =>
144
144
```
145
145
<1> Using this URL will require two redirects, allowing us to see multiple spans in the trace.
146
146
147
- The Elastic distribution will automatically enable the exporting of signals via the OTLP exporter. This
147
+ The Elastic Distribution for OpenTelemetry .NET will automatically enable the exporting of signals via the OTLP exporter. This
148
148
exporter requires that endpoint(s) are configured. A common mechanism for configuring endpoints is
149
149
via environment variables.
150
150
0 commit comments