use of com.uber.jaeger.metrics.Metrics in project cxf by apache.
the class Client method main.
public static void main(final String[] args) throws Exception {
final Metrics metrics = new Metrics(new StatsFactoryImpl(new NullStatsReporter()));
final Tracer.Builder builder = new Tracer.Builder("cxf-client", new RemoteReporter(new HttpSender("http://localhost:14268/api/traces"), 1000, 100, metrics), new ConstSampler(true));
final OpenTracingClientProvider provider = new OpenTracingClientProvider(builder.build());
final javax.ws.rs.client.Client client = ClientBuilder.newClient().register(provider);
final Response response = client.target("http://localhost:8084/catalog").request().accept(MediaType.APPLICATION_JSON).get();
LOG.info("Response: {}", response.readEntity(String.class));
response.close();
// Allow Tracer to flush
Thread.sleep(1000);
}
use of com.uber.jaeger.metrics.Metrics in project cxf by apache.
the class Server method tracer.
@Bean
Tracer tracer() {
final Metrics metrics = new Metrics(new StatsFactoryImpl(new NullStatsReporter()));
final Tracer.Builder builder = new Tracer.Builder("camel-server", new RemoteReporter(new HttpSender("http://localhost:14268/api/traces"), 1000, 100, metrics), new ConstSampler(true)).registerExtractor(Builtin.TEXT_MAP, new TextMapCodec(true));
return builder.build();
}
use of com.uber.jaeger.metrics.Metrics in project jaeger-client-java by jaegertracing.
the class MicrometerTest method setUp.
@Before
public void setUp() {
registry = io.micrometer.core.instrument.Metrics.globalRegistry;
prometheusRegistry = new PrometheusMeterRegistry(PrometheusConfig.DEFAULT);
io.micrometer.core.instrument.Metrics.addRegistry(prometheusRegistry);
metrics = new Metrics(new MicrometerMetricsFactory());
}
use of com.uber.jaeger.metrics.Metrics in project jaeger-client-java by jaegertracing.
the class TracerTest method testRegisterInjector.
@Test
public void testRegisterInjector() {
@SuppressWarnings("unchecked") Injector<TextMap> injector = mock(Injector.class);
Tracer tracer = new Tracer.Builder("TracerTestService", new InMemoryReporter(), new ConstSampler(true)).withMetrics(new Metrics(new InMemoryMetricsFactory())).registerInjector(Format.Builtin.TEXT_MAP, injector).build();
Span span = (Span) tracer.buildSpan("leela").start();
TextMap carrier = mock(TextMap.class);
tracer.inject(span.context(), Format.Builtin.TEXT_MAP, carrier);
verify(injector).inject(any(SpanContext.class), any(TextMap.class));
}
use of com.uber.jaeger.metrics.Metrics in project jaeger-client-java by jaegertracing.
the class TracerTest method setUp.
@Before
public void setUp() throws Exception {
metricsFactory = new InMemoryMetricsFactory();
tracer = new Tracer.Builder("TracerTestService").withReporter(new InMemoryReporter()).withSampler(new ConstSampler(true)).withMetrics(new Metrics(metricsFactory)).build();
}
Aggregations