Implementing custom telemetry capture
We will create a simple example that will allow us to not only see how the OpenTelemetry SDK works but also how Meter
objects can be used to house many different counters and data points:
- Create a new Minimal API project in Visual Studio or with the
dotnet
command line. Here is the screenshot for the new Minimal API project:
Here is the screenshot for the dotnet
command-line interface:
- Be sure to uncheck the Use controllers checkbox to use minimal APIs if using the new project dialog from Visual Studio:
- Add a NuGet reference to
System.Diagnostics.DiagnosticSource
andOpenTelemetry.Instrumentation.EventCounters
:dotnet add package System...