Search in sources :

Example 1 with Format

use of io.opentracing.propagation.Format in project jaeger-client-java by jaegertracing.

the class Configuration method getTracerBuilder.

public Tracer.Builder getTracerBuilder() {
    if (reporterConfig == null) {
        reporterConfig = new ReporterConfiguration();
    }
    if (samplerConfig == null) {
        samplerConfig = new SamplerConfiguration();
    }
    if (codecConfig == null) {
        codecConfig = new CodecConfiguration(Collections.<Format<?>, List<Codec<TextMap>>>emptyMap());
    }
    if (metricsFactory == null) {
        metricsFactory = new NoopMetricsFactory();
    }
    Metrics metrics = new Metrics(metricsFactory);
    Reporter reporter = reporterConfig.getReporter(metrics);
    Sampler sampler = samplerConfig.createSampler(serviceName, metrics);
    Tracer.Builder builder = new Tracer.Builder(serviceName).withSampler(sampler).withReporter(reporter).withMetrics(metrics).withTags(tracerTags);
    codecConfig.apply(builder);
    return builder;
}
Also used : Reporter(com.uber.jaeger.reporters.Reporter) LoggingReporter(com.uber.jaeger.reporters.LoggingReporter) CompositeReporter(com.uber.jaeger.reporters.CompositeReporter) RemoteReporter(com.uber.jaeger.reporters.RemoteReporter) Metrics(com.uber.jaeger.metrics.Metrics) NumberFormat(java.text.NumberFormat) Format(io.opentracing.propagation.Format) RemoteControlledSampler(com.uber.jaeger.samplers.RemoteControlledSampler) RateLimitingSampler(com.uber.jaeger.samplers.RateLimitingSampler) Sampler(com.uber.jaeger.samplers.Sampler) ConstSampler(com.uber.jaeger.samplers.ConstSampler) ProbabilisticSampler(com.uber.jaeger.samplers.ProbabilisticSampler) LinkedList(java.util.LinkedList) List(java.util.List) TextMap(io.opentracing.propagation.TextMap) NoopMetricsFactory(com.uber.jaeger.metrics.NoopMetricsFactory)

Aggregations

Metrics (com.uber.jaeger.metrics.Metrics)1 NoopMetricsFactory (com.uber.jaeger.metrics.NoopMetricsFactory)1 CompositeReporter (com.uber.jaeger.reporters.CompositeReporter)1 LoggingReporter (com.uber.jaeger.reporters.LoggingReporter)1 RemoteReporter (com.uber.jaeger.reporters.RemoteReporter)1 Reporter (com.uber.jaeger.reporters.Reporter)1 ConstSampler (com.uber.jaeger.samplers.ConstSampler)1 ProbabilisticSampler (com.uber.jaeger.samplers.ProbabilisticSampler)1 RateLimitingSampler (com.uber.jaeger.samplers.RateLimitingSampler)1 RemoteControlledSampler (com.uber.jaeger.samplers.RemoteControlledSampler)1 Sampler (com.uber.jaeger.samplers.Sampler)1 Format (io.opentracing.propagation.Format)1 TextMap (io.opentracing.propagation.TextMap)1 NumberFormat (java.text.NumberFormat)1 LinkedList (java.util.LinkedList)1 List (java.util.List)1