opentelemetry-dotnet/examples/AspNetCore
Cijo Thomas f4dddbe7da
Add runtime metrics to example aspnet core app (#3408)
2022-06-28 06:08:46 -07:00
..
Controllers Fix analyzers (#3053) 2022-04-01 07:46:32 -07:00
Models Asp6sample (#2989) 2022-03-10 12:33:12 -08:00
Examples.AspNetCore.csproj Add runtime metrics to example aspnet core app (#3408) 2022-06-28 06:08:46 -07:00
Program.cs Add runtime metrics to example aspnet core app (#3408) 2022-06-28 06:08:46 -07:00
README.md Asp6sample (#2989) 2022-03-10 12:33:12 -08:00
appsettings.json Modify example asp.net core app to config prometheus options (#2988) 2022-03-10 10:52:25 -08:00

README.md

OpenTelemetry ASP.Net Core 6 Web API Example

This example uses the new WebApplication host that ships with .Net 6 and shows how to setup

  1. OpenTelemetry logging
  2. OpenTelemetry metrics
  3. 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.

References