Exemple #1
0
 internal static TracerProviderBuilder AddHttpClientInstrumentation(
     this TracerProviderBuilder builder,
     HttpClientInstrumentation instrumentation)
 {
     builder.AddSource(HttpHandlerDiagnosticListener.ActivitySourceName);
     builder.AddLegacySource("System.Net.Http.HttpRequestOut");
     return(builder.AddInstrumentation(() => instrumentation));
 }
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddOpenTelemetry(() =>
            {
                var tracerFactory = new LoggingTracerFactory();
                var tracer        = tracerFactory.GetTracer("ServerApp", "semver:1.0.0");

                var dependenciesInstrumentation = new HttpClientInstrumentation();
                var aspNetCoreInstrumentation   = new AspNetCoreInstrumentation();

                return(tracerFactory);
            });
        }