Exemplo n.º 1
0
        private static IMongoClient CreateFromOptions(CallistoConnectorOptions options, ApplicationOptions app)
        {
            CallistoJaegerEventListener eventListener = null;
            if (options.Trace)
            {
                if (GlobalTracer.Instance != null)
                {
                    eventListener = new CallistoJaegerEventListener(GlobalTracer.Instance, new EventFilter(), Options.Create(new CallistoTracerOptions()));
                }
            }

            MongoUrl url = options.CreateUrl(app);
            MongoClientSettings settings = url.CreateMongoClientSettings();
            if (eventListener != null)
                settings.ConfigureTracing(options.Trace, eventListener);
            return settings.CreateMongoClient();
        }