Esempio n. 1
0
        public static async Task Main(string[] args)
        {
            var tracerFactory = new LoggingTracerFactory();
            var tracer        = tracerFactory.GetTracer("ConsoleApp", "semver:1.0.0");

            using (tracer.WithSpan(tracer.StartSpan("Main (span1)")))
            {
                await Task.Delay(100);
                await Foo(tracer);
            }
        }
Esempio n. 2
0
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddOpenTelemetry(() =>
            {
                var tracerFactory = new LoggingTracerFactory();
                var tracer        = tracerFactory.GetTracer("ServerApp", "semver:1.0.0");

                var dependenciesCollector = new DependenciesCollector(tracerFactory);
                var aspNetCoreCollector   = new AspNetCoreCollector(tracer);

                return(tracerFactory);
            });
        }