Search in sources :

Example 1 with EndToEndBehavior

use of io.jaegertracing.crossdock.resources.behavior.EndToEndBehavior in project jaeger-client-java by jaegertracing.

the class EndToEndBehaviorResourceTest method setUp.

@Before
public void setUp() throws Exception {
    reporter = new InMemoryReporter();
    Tracer tracer = new JaegerTracer.Builder("crossdock-java").withReporter(reporter).withSampler(new ConstSampler(true)).build();
    Map<String, Tracer> tracers = new HashMap<>();
    tracers.put("const", tracer);
    resource = new EndToEndBehaviorResource(new EndToEndBehavior(tracers));
}
Also used : InMemoryReporter(io.jaegertracing.internal.reporters.InMemoryReporter) EndToEndBehavior(io.jaegertracing.crossdock.resources.behavior.EndToEndBehavior) HashMap(java.util.HashMap) Tracer(io.opentracing.Tracer) JaegerTracer(io.jaegertracing.internal.JaegerTracer) ConstSampler(io.jaegertracing.internal.samplers.ConstSampler) JaegerTracer(io.jaegertracing.internal.JaegerTracer) Before(org.junit.Before)

Example 2 with EndToEndBehavior

use of io.jaegertracing.crossdock.resources.behavior.EndToEndBehavior in project jaeger-client-java by jaegertracing.

the class JerseyServer method main.

public static void main(String[] args) throws Exception {
    BasicConfigurator.configure();
    String serviceName = serviceNameFromEnv();
    Configuration configuration = new Configuration(serviceName).withSampler(new SamplerConfiguration().withType(ConstSampler.TYPE).withParam(0)).withReporter(new ReporterConfiguration().withLogSpans(true));
    JerseyServer server = new JerseyServer("0.0.0.0", 8081, configuration, Arrays.asList(new TraceBehaviorResource(configuration.getTracer()), new EndToEndBehaviorResource(new EndToEndBehavior(getEvn(SAMPLING_HOST_PORT, "jaeger-agent:5778"), "crossdock-" + serviceName, senderFromEnv(getEvn(COLLECTOR_HOST_PORT, "jaeger-collector:14268"), getEvn(AGENT_HOST, "jaeger-agent")))), new HealthResource()));
    server.addNetworkListener(new NetworkListener("health", "0.0.0.0", 8080));
    Thread.currentThread().join();
}
Also used : EndToEndBehavior(io.jaegertracing.crossdock.resources.behavior.EndToEndBehavior) ReporterConfiguration(io.jaegertracing.Configuration.ReporterConfiguration) Configuration(io.jaegertracing.Configuration) SamplerConfiguration(io.jaegertracing.Configuration.SamplerConfiguration) TraceBehaviorResource(io.jaegertracing.crossdock.resources.behavior.http.TraceBehaviorResource) SamplerConfiguration(io.jaegertracing.Configuration.SamplerConfiguration) EndToEndBehaviorResource(io.jaegertracing.crossdock.resources.behavior.http.EndToEndBehaviorResource) ReporterConfiguration(io.jaegertracing.Configuration.ReporterConfiguration) HealthResource(io.jaegertracing.crossdock.resources.health.HealthResource) NetworkListener(org.glassfish.grizzly.http.server.NetworkListener)

Aggregations

EndToEndBehavior (io.jaegertracing.crossdock.resources.behavior.EndToEndBehavior)2 Configuration (io.jaegertracing.Configuration)1 ReporterConfiguration (io.jaegertracing.Configuration.ReporterConfiguration)1 SamplerConfiguration (io.jaegertracing.Configuration.SamplerConfiguration)1 EndToEndBehaviorResource (io.jaegertracing.crossdock.resources.behavior.http.EndToEndBehaviorResource)1 TraceBehaviorResource (io.jaegertracing.crossdock.resources.behavior.http.TraceBehaviorResource)1 HealthResource (io.jaegertracing.crossdock.resources.health.HealthResource)1 JaegerTracer (io.jaegertracing.internal.JaegerTracer)1 InMemoryReporter (io.jaegertracing.internal.reporters.InMemoryReporter)1 ConstSampler (io.jaegertracing.internal.samplers.ConstSampler)1 Tracer (io.opentracing.Tracer)1 HashMap (java.util.HashMap)1 NetworkListener (org.glassfish.grizzly.http.server.NetworkListener)1 Before (org.junit.Before)1