Beispiel #1
0
        public static TracerProviderBuilder AddMongoDBInstrumentation(this TracerProviderBuilder builder, Action <MongoDBInstrumentationOptions> configureInstrumentationOptions)
        {
            configureInstrumentationOptions ??= opt => { };

            var options = new MongoDBInstrumentationOptions();

            configureInstrumentationOptions(options);

            return(builder.AddInstrumentation(t => new MongoDBCommandAdapter(t, options)));
        }
Beispiel #2
0
 public MongoDBCommandAdapter(ActivitySourceAdapter activitySource, MongoDBInstrumentationOptions options)
 {
     _diagnosticSourceSubscriber = new DiagnosticSourceSubscriber(new CommandListener(activitySource, options), null);
     _diagnosticSourceSubscriber.Subscribe();
 }