You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/docs/getting-started/dotnet-sdk.mdx
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
---
2
-
title: 'Getting Started with the .NET SDK on Traces Instrumentation'
2
+
title: 'Getting Started with the .NET SDK on Traces and Metrics Instrumentation'
3
3
description:
4
4
OpenTelemetry provides different language SDKs to instrument code for collecting telemetry data in the application.
5
-
In this doc, we will introduce how to use OpenTelemetry .NET SDK for traces instrumentation in the application
5
+
In this doc, we will introduce how to use OpenTelemetry .NET SDK for traces and metrics instrumentation in the application
6
6
path: '/docs/getting-started/dotnet-sdk'
7
7
---
8
8
@@ -16,9 +16,9 @@ In this tutorial, we will introduce how to use OpenTelemetry .NET SDK for manual
16
16
17
17
## Getting Started
18
18
19
-
*[Manual Instrumentation on Traces with OpenTelemetry .NET SDK](/docs/getting-started/dotnet-sdk/trace-manual-instr)
19
+
*[Manual Instrumentation on Traces and Metrics with OpenTelemetry .NET SDK](/docs/getting-started/dotnet-sdk/manual-instr)
20
20
21
21
22
22
## Sample Code
23
23
24
-
*[AWS Distro for OpenTelemetry Sample Code with .NET SDK](https://github.com/aws-observability/aws-otel-dotnet/tree/main/integration-test-app)
24
+
*[AWS Distro for OpenTelemetry Sample Code with .NET SDK](https://github.com/aws-observability/aws-otel-community/tree/master/sample-apps/dotnet-sample-app)
The AWS Distro for OpenTelemetry .NET SDK contains an extension library for using OpenTelemetry with AWS X-Ray and for instrumenting the AWS SDK. In this tutorial, we will introduce how to manually instrument your application step-by-step using AWS Distro for OpenTelemetry .NET SDK.
12
+
The AWS Distro for OpenTelemetry .NET SDK contains an extension library for instrumenting the AWS SDK. In this tutorial, we will introduce how to manually instrument your application for traces and metrics step-by-step using AWS Distro for OpenTelemetry .NET SDK.
13
13
14
14
<SectionSeparator />
15
15
16
16
## Requirements
17
17
18
18
The AWS Distro for OpenTelemetry .NET SDK is compatible for all the officially supported versions of [.NET](https://dotnet.microsoft.com/en-us/download/dotnet) and [.NET Framework](https://dotnet.microsoft.com/en-us/download/dotnet-framework).
19
19
20
-
**Note**: You’ll also need to have the [AWS Distro for OpenTelemetry Collector](https://aws-otel.github.io/docs/getting-started/collector) running to export traces to X-Ray.
20
+
**Note**: You’ll also need to have the [AWS Distro for OpenTelemetry Collector](https://aws-otel.github.io/docs/getting-started/collector) running to export traces and metrics.
21
21
22
22
<SectionSeparator />
23
23
24
24
## Installation
25
25
26
-
In order to instrument your .NET application for tracing, start by downloading the `OpenTelemetry` nuget package to your application.
26
+
In order to instrument your .NET application for traces and metrics, start by downloading the `OpenTelemetry` nuget package to your application.
27
27
28
28
```shell
29
29
dotnet add package OpenTelemetry
@@ -40,7 +40,7 @@ If you plan to call another application instrumented with AWS X-Ray SDK, you’l
@@ -50,22 +50,29 @@ By default the OpenTelemetry exporter sends data to an OpenTelemetry collector a
50
50
51
51
<SectionSeparator />
52
52
53
-
## Setting up the Global Tracer
53
+
## Setting up the Global Tracer and Meter
54
54
55
-
### Sending Traces to AWS X-Ray
55
+
### Sending Traces and Metrics
56
56
57
57
Configure AWS X-Ray ID generator, propagator and OpenTelemetry Protocol (OTLP) exporter globally in your application as follows. Make sure to call `AddXRayTraceId()` in the very **beginning** when creating `TracerProvider`
58
+
Also configure the meter provider and add a meter of your choice as well as the OpenTelemetry Protocol (OTLP) exporter.
@@ -152,8 +159,30 @@ Attributes are converted to metadata by default. If you configure your collector
152
159
153
160
For more information about the activity API, see the [OpenTelemetry .NET SDK's developer guide](https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/src/OpenTelemetry.Api#instrumenting-a-libraryapplication-with-net-activity-api).
154
161
162
+
### Creating Metrics
163
+
164
+
Similarly to Traces, you can create custom metrics in your application using the OpenTelemetry API and SDK.
165
+
166
+
In the following example application we demonstrate how to use metric instruments to record metrics with a Counter.
Take a reference to the [sample application](https://github.com/aws-observability/aws-otel-dotnet/tree/main/integration-test-app) that is instrumented by ADOT and OpenTelemetry .NET SDK.
188
+
Take a reference to the [sample application](https://github.com/aws-observability/aws-otel-community/tree/master/sample-apps/dotnet-sample-app) that is instrumented by ADOT and OpenTelemetry .NET SDK.
0 commit comments