Example #1
0
        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));
            }
        }
Example #2
0
        private static ISampler GetSampler(JaegerOptions options)
        {
            //sampler use for when we don't want send every thing for tracing to jaeger but imagine we wll have
            //thousand or milion request and that would paintfull to report every request to jaeger.and we need sample this
            //data
            switch (options.Sampler)
            {
            //sample some constant number that was less there is picked by jaeger
            case "const": return(new ConstSampler(true));

            //max rate per second, max number trace by jaeger per second
            case "rate": return(new RateLimitingSampler(options.MaxTracesPerSecond));

            //we can say trace for example 5% of our total requests
            case "probabilistic": return(new ProbabilisticSampler(options.SamplingRate));

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