Enabling auto-collection with OpenTelemetry
In this section, we’re going to add OpenTelemetry to our demo application and enable auto-collection for ASP.NET Core, HttpClient
, Entity Framework, and runtime metrics. We’ll see what it adds to the bare-bones monitoring experience.
We’ll export traces to Jaeger and metrics to Prometheus, as shown in Figure 2.7:
Figure 2.7 – Meme services sending telemetry to Jaeger and Prometheus
You can also send data directly to your observability backend if it has an OTLP endpoint, or you can configure a backend-specific exporter in the application. So, let’s get started and instrument our application with OpenTelemetry.
Installing and configuring OpenTelemetry
OpenTelemetry comes as a set of NuGet packages. Here are a few that we’re using in our demo app:
OpenTelemetry
: The SDK that contains all that we need to produce traces and metrics and configure a generic...