Search in sources :

Example 11 with Metrics

use of com.uber.jaeger.metrics.Metrics in project jaeger-client-java by jaegertracing.

the class RemoteReporterTest method setUp.

@Before
public void setUp() throws Exception {
    metricsFactory = new InMemoryMetricsFactory();
    metrics = new Metrics(metricsFactory);
    sender = new InMemorySender();
    reporter = new RemoteReporter.Builder().withSender(sender).withFlushInterval(flushInterval).withMaxQueueSize(maxQueueSize).withMetrics(metrics).build();
    tracer = new Tracer.Builder("test-remote-reporter", reporter, new ConstSampler(true)).withMetrics(metrics).build();
}
Also used : InMemoryMetricsFactory(com.uber.jaeger.metrics.InMemoryMetricsFactory) Metrics(com.uber.jaeger.metrics.Metrics) Tracer(com.uber.jaeger.Tracer) ConstSampler(com.uber.jaeger.samplers.ConstSampler) Before(org.junit.Before)

Example 12 with Metrics

use of com.uber.jaeger.metrics.Metrics 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)

Example 13 with Metrics

use of com.uber.jaeger.metrics.Metrics in project jaeger-client-java by jaegertracing.

the class ConfigurationTest method testProbabilisticSampler.

@Test
public void testProbabilisticSampler() {
    SamplerConfiguration samplerConfiguration = new SamplerConfiguration().withType(ProbabilisticSampler.TYPE);
    Sampler sampler = samplerConfiguration.createSampler("name", new Metrics(new StatsFactoryImpl(new NullStatsReporter())));
    assertTrue(sampler instanceof ProbabilisticSampler);
}
Also used : Metrics(com.uber.jaeger.metrics.Metrics) NullStatsReporter(com.uber.jaeger.metrics.NullStatsReporter) RateLimitingSampler(com.uber.jaeger.samplers.RateLimitingSampler) Sampler(com.uber.jaeger.samplers.Sampler) ConstSampler(com.uber.jaeger.samplers.ConstSampler) ProbabilisticSampler(com.uber.jaeger.samplers.ProbabilisticSampler) SamplerConfiguration(com.uber.jaeger.Configuration.SamplerConfiguration) StatsFactoryImpl(com.uber.jaeger.metrics.StatsFactoryImpl) ProbabilisticSampler(com.uber.jaeger.samplers.ProbabilisticSampler) Test(org.junit.Test)

Aggregations

Metrics (com.uber.jaeger.metrics.Metrics)13 ConstSampler (com.uber.jaeger.samplers.ConstSampler)12 InMemoryMetricsFactory (com.uber.jaeger.metrics.InMemoryMetricsFactory)5 NullStatsReporter (com.uber.jaeger.metrics.NullStatsReporter)5 StatsFactoryImpl (com.uber.jaeger.metrics.StatsFactoryImpl)5 InMemoryReporter (com.uber.jaeger.reporters.InMemoryReporter)5 Before (org.junit.Before)5 Test (org.junit.Test)5 Tracer (com.uber.jaeger.Tracer)4 ProbabilisticSampler (com.uber.jaeger.samplers.ProbabilisticSampler)4 RateLimitingSampler (com.uber.jaeger.samplers.RateLimitingSampler)4 Sampler (com.uber.jaeger.samplers.Sampler)4 SamplerConfiguration (com.uber.jaeger.Configuration.SamplerConfiguration)3 Builder (com.uber.jaeger.Tracer.Builder)3 RemoteReporter (com.uber.jaeger.reporters.RemoteReporter)3 HttpSender (com.uber.jaeger.senders.HttpSender)2 TextMap (io.opentracing.propagation.TextMap)2 DefaultBaggageRestrictionManager (com.uber.jaeger.baggage.DefaultBaggageRestrictionManager)1 NoopMetricsFactory (com.uber.jaeger.metrics.NoopMetricsFactory)1 TextMapCodec (com.uber.jaeger.propagation.TextMapCodec)1