After enabling Aspire for your application, you get OpenTelemetry integration for free thanks to the included ServiceDefaults code.
This will setup OpenTelemetry using a set of defaults:
Unfortunately this default configuration didn’t pick up any of the custom metrics I added.
I first thought that this meant that I couldn’t use the service defaults anymore and configure the OpenTelemetry integration manually.
But then I discovered that you can change/extend the default configuration in a specific project by using the ConfigureOpenTelemetryTracerProvider and/or ConfigureOpenTelemetryMeterProvider methods.
Add your custom OpenTelemetry configuration after calling the Aspire builder.AddServiceDefaults():
Now our custom metrics appear nicely in the Aspire dashboard:

