private static JaegerOptions GetJaegerOptions(IServiceCollection services)
        {
            using (var serviceProvider = services.BuildServiceProvider())
            {
                var configuration = serviceProvider.GetService <IConfiguration>();
                var options       = new JaegerOptions();
                configuration.Bind("Jaeger", options);

                return(options);
            }
        }
        private static ISampler GetSampler(JaegerOptions options)
        {
            switch (options.Sampler)
            {
            case "const": return(new ConstSampler(true));

            case "rate": return(new RateLimitingSampler(options.MaxTracesPerSecond));

            case "probabilistic": return(new ProbabilisticSampler(options.SamplingRate));

            default: return(new ConstSampler(true));
            }
        }