To create a new Activity, use the ActivitySource class.
usingSystem.Diagnostics;publicstaticclassTelemetry{// Name it after the service name for your app.// It can come from a config file, constants file, etc.publicstaticreadonlyActivitySource MyActivitySource =new(TelemetryConstants.ServiceName);publicstaticvoidMyMethod(){using(var activity = MyActivitySource.StartActivity("MyMethod")){// Your code here}}}