This example uses the new WebApplication host that ships with .NET 7 and shows how to setup
- OpenTelemetry logging
- OpenTelemetry metrics
- OpenTelemetry tracing
ResourceBuilder
is associated with OpenTelemetry to associate the
service name, version and the machine on which this program is running.
The sample rate is set to emit all the traces using AlwaysOnSampler
.
You can try out different samplers like TraceIdRatioBasedSampler
.