dotnet add package OpenTelemetry
using System.Diagnostics;
public static class Telemetry
{
public static readonly ActivitySource MyActivitySource = new(TelemetryConstants.ServiceName);
public static void MyMethod()
{
using (var activity = MyActivitySource.StartActivity("MyMethod"))
{
}
}
}