Skip to content

Commit bdd2122

Browse files
Update content/1.posts/71.aspire-open-telemetry.md
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent d7efc27 commit bdd2122

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

content/1.posts/71.aspire-open-telemetry.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ That's great, but if we want to see telemetry from our web application, we first
2525

2626
## Add the instrumentation code to the `WebApi`
2727

28-
The [OpenTelemetry SDK for .NET](https://github.com/open-telemetry/opentelemetry-dotnet) includes everything we need to collect the telemetry data (logs, traces, metrics). So we could directly install the nuget packages in the `WebApi` project, and implement the code to configure the instrumentation and use the the Aspire dashboard OTLP endpoint.It would work, and if you already have an app using OpenTelemetry, you likely only need to make a few configuration changes to make it compatible with the Aspire dashboard.
28+
The [OpenTelemetry SDK for .NET](https://github.com/open-telemetry/opentelemetry-dotnet) includes everything we need to collect the telemetry data (logs, traces, metrics). So we could directly install the nuget packages in the `WebApi` project, and implement the code to configure the instrumentation and use the Aspire dashboard OTLP endpoint. It would work, and if you already have an app using OpenTelemetry, you likely only need to make a few configuration changes to make it compatible with the Aspire dashboard.
2929

3030
In our case, we will use instead a [Aspire service defaults project](https://learn.microsoft.com/en-us/dotnet/aspire/fundamentals/service-defaults?wt.mc_id=MVP_430820) to set everything up easily. The purpose of using this Aspire Shared project is to offer predefined extension methods that help configure things like OpenTelemetry, health check endpoints, retry policies, and more across the various services and resources that make up the application. Let’s create this project using the `aspire-servicedefaults` template (from the [Aspire template](https://learn.microsoft.com/en-us/dotnet/aspire/fundamentals/aspire-sdk-templates?pivots=dotnet-cli&wt.mc_id=MVP_430820)) and reference it in the `WebApi` project.
3131

0 commit comments

Comments
 (0)