To start emitting Otel tracing and metrics information you need

  • add the Otel libraries to your IdentityServer and client applications
  • start collecting traces and Metrics from the various IdentityServer sources (and other sources e.g. ASP.NET Core)

For development a simple option is to export the tracing information to the console and use the Prometheus exporter to create a human readable /metrics endpoint for the metrics.

Add the Open Telemetry configuration to your service setup.

var openTelemetry = builder.Services.AddOpenTelemetry();

openTelemetry.ConfigureResource(r => r

openTelemetry.WithMetrics(m => m

openTelemetry.WithTracing(t => t

Add the Prometheus exporter to the pipeline

// Map /metrics that displays Otel data in human readable form.

This setup will write the tracing information to the console and provide metrics on the /metrics endpoint.