Configuration { public synchronized JaegerTracer getTracer() { if (tracer != null) { return tracer; } tracer = getTracerBuilder().build(); log.info("Initialized tracer={}", tracer); return tracer; } Configuration(String serviceName); static Configuration fromEnv(); static Configuration fromEnv(String serviceName); JaegerTracer.Builder getTracerBuilder(); synchronized JaegerTracer getTracer(); synchronized void closeTracer(); Configuration withMetricsFactory(MetricsFactory metricsFactory); Configuration withServiceName(String serviceName); Configuration withReporter(ReporterConfiguration reporterConfig); Configuration withSampler(SamplerConfiguration samplerConfig); Configuration withCodec(CodecConfiguration codecConfig); Configuration withTraceId128Bit(boolean useTraceId128Bit); Configuration withTracerTags(Map<String, String> tracerTags); String getServiceName(); ReporterConfiguration getReporter(); SamplerConfiguration getSampler(); CodecConfiguration getCodec(); MetricsFactory getMetricsFactory(); Map<String, String> getTracerTags(); static final String JAEGER_PREFIX; static final String JAEGER_ENDPOINT; static final String JAEGER_AUTH_TOKEN; static final String JAEGER_USER; static final String JAEGER_PASSWORD; static final String JAEGER_AGENT_HOST; static final String JAEGER_AGENT_PORT; static final String JAEGER_REPORTER_LOG_SPANS; static final String JAEGER_REPORTER_MAX_QUEUE_SIZE; static final String JAEGER_REPORTER_FLUSH_INTERVAL; static final String JAEGER_SAMPLER_TYPE; static final String JAEGER_SAMPLER_PARAM; static final String JAEGER_SAMPLER_MANAGER_HOST_PORT; static final String JAEGER_SERVICE_NAME; static final String JAEGER_TAGS; static final String JAEGER_PROPAGATION; static final String JAEGER_SENDER_FACTORY; static final String JAEGER_TRACEID_128BIT; }
@Test public void testDefaultCodecs() { Configuration configuration = new Configuration("foo"); long traceIdLow = 2L; long spanId = 11L; long parentId = 22L; JaegerSpanContext spanContext = new JaegerSpanContext(0, traceIdLow, spanId, parentId, (byte) 0); assertInjectExtract(configuration.getTracer(), Builtin.TEXT_MAP, spanContext, false); assertInjectExtract(configuration.getTracer(), Builtin.HTTP_HEADERS, spanContext, false); assertBinaryInjectExtract(configuration.getTracer(), spanContext); }