@Test public void shouldConfigureWhenProducerDefaultConfig() { initialConfig.put(ProducerConfig.CLIENT_ID_CONFIG, "producer-app"); BaseTracingInterceptor interceptor = new BaseTracingInterceptorImpl(); interceptor.configure(initialConfig); assertNotNull(interceptor.tracing); assertEquals(TracingInterceptorConfig.ZIPKIN_REMOTE_SERVICE_NAME_DEFAULT, interceptor.remoteServiceName); }
@Override public void configure(Map<String, ?> map) { groupId = extractString(map, ConsumerConfig.GROUP_ID_CONFIG); clientId = extractString(map, ProducerConfig.CLIENT_ID_CONFIG); boolean traceId128bitEnabled = Optional.ofNullable(extractString(map, TracingInterceptorConfig.ZIPKIN_TRACE_ID_128BIT_ENABLED_CONFIG)) .map(Boolean::valueOf).orElse(TracingInterceptorConfig.ZIPKIN_TRACE_ID_128BIT_ENABLED_DEFAULT); final Reporter<Span> reporter = buildReporter(map); final String localServiceName = getLocalServiceName(map); final Float samplerRate = getSamplerRate(map); final Tracing.Builder tracingBuilder = Tracing.newBuilder() .localServiceName(localServiceName) .traceId128Bit(traceId128bitEnabled) .sampler(Sampler.create(samplerRate)); if (reporter != null) { tracingBuilder.spanReporter(reporter); } tracing = tracingBuilder.build(); injector = tracing.propagation().injector(KafkaPropagation.HEADER_SETTER); extractor = tracing.propagation().extractor(KafkaPropagation.HEADER_GETTER); remoteServiceName = getRemoteServiceName(map); LOGGER.info("Zipkin Interceptor configured with local service name {} and " + "remote service name {}", localServiceName, remoteServiceName); }
BaseTracingInterceptor implements Configurable { @Override public void configure(Map<String, ?> map) { groupId = extractString(map, ConsumerConfig.GROUP_ID_CONFIG); clientId = extractString(map, ProducerConfig.CLIENT_ID_CONFIG); boolean traceId128bitEnabled = Optional.ofNullable(extractString(map, TracingInterceptorConfig.ZIPKIN_TRACE_ID_128BIT_ENABLED_CONFIG)) .map(Boolean::valueOf).orElse(TracingInterceptorConfig.ZIPKIN_TRACE_ID_128BIT_ENABLED_DEFAULT); final Reporter<Span> reporter = buildReporter(map); final String localServiceName = getLocalServiceName(map); final Float samplerRate = getSamplerRate(map); final Tracing.Builder tracingBuilder = Tracing.newBuilder() .localServiceName(localServiceName) .traceId128Bit(traceId128bitEnabled) .sampler(Sampler.create(samplerRate)); if (reporter != null) { tracingBuilder.spanReporter(reporter); } tracing = tracingBuilder.build(); injector = tracing.propagation().injector(KafkaPropagation.HEADER_SETTER); extractor = tracing.propagation().extractor(KafkaPropagation.HEADER_GETTER); remoteServiceName = getRemoteServiceName(map); LOGGER.info("Zipkin Interceptor configured with local service name {} and " + "remote service name {}", localServiceName, remoteServiceName); } }
BaseTracingInterceptor implements Configurable { @Override public void configure(Map<String, ?> map) { groupId = extractString(map, ConsumerConfig.GROUP_ID_CONFIG); clientId = extractString(map, ProducerConfig.CLIENT_ID_CONFIG); boolean traceId128bitEnabled = Optional.ofNullable(extractString(map, TracingInterceptorConfig.ZIPKIN_TRACE_ID_128BIT_ENABLED_CONFIG)) .map(Boolean::valueOf).orElse(TracingInterceptorConfig.ZIPKIN_TRACE_ID_128BIT_ENABLED_DEFAULT); final Reporter<Span> reporter = buildReporter(map); final String localServiceName = getLocalServiceName(map); final Float samplerRate = getSamplerRate(map); final Tracing.Builder tracingBuilder = Tracing.newBuilder() .localServiceName(localServiceName) .traceId128Bit(traceId128bitEnabled) .sampler(Sampler.create(samplerRate)); if (reporter != null) { tracingBuilder.spanReporter(reporter); } tracing = tracingBuilder.build(); injector = tracing.propagation().injector(KafkaPropagation.HEADER_SETTER); extractor = tracing.propagation().extractor(KafkaPropagation.HEADER_GETTER); remoteServiceName = getRemoteServiceName(map); LOGGER.info("Zipkin Interceptor configured with local service name {} and " + "remote service name {}", localServiceName, remoteServiceName); }  }
BaseTracingInterceptor implements Configurable { @Override public void configure(Map<String, ?> map) { groupId = extractString(map, ConsumerConfig.GROUP_ID_CONFIG); clientId = extractString(map, ProducerConfig.CLIENT_ID_CONFIG); boolean traceId128bitEnabled = Optional.ofNullable(extractString(map, TracingInterceptorConfig.ZIPKIN_TRACE_ID_128BIT_ENABLED_CONFIG)) .map(Boolean::valueOf).orElse(TracingInterceptorConfig.ZIPKIN_TRACE_ID_128BIT_ENABLED_DEFAULT); final Reporter<Span> reporter = buildReporter(map); final String localServiceName = getLocalServiceName(map); final Float samplerRate = getSamplerRate(map); final Tracing.Builder tracingBuilder = Tracing.newBuilder() .localServiceName(localServiceName) .traceId128Bit(traceId128bitEnabled) .sampler(Sampler.create(samplerRate)); if (reporter != null) { tracingBuilder.spanReporter(reporter); } tracing = tracingBuilder.build(); injector = tracing.propagation().injector(KafkaPropagation.HEADER_SETTER); extractor = tracing.propagation().extractor(KafkaPropagation.HEADER_GETTER); remoteServiceName = getRemoteServiceName(map); LOGGER.info("Zipkin Interceptor configured with local service name {} and " + "remote service name {}", localServiceName, remoteServiceName); }  @Override void configure(Map<String, ?> map); }
BaseTracingInterceptor implements Configurable { @Override public void configure(Map<String, ?> map) { groupId = extractString(map, ConsumerConfig.GROUP_ID_CONFIG); clientId = extractString(map, ProducerConfig.CLIENT_ID_CONFIG); boolean traceId128bitEnabled = Optional.ofNullable(extractString(map, TracingInterceptorConfig.ZIPKIN_TRACE_ID_128BIT_ENABLED_CONFIG)) .map(Boolean::valueOf).orElse(TracingInterceptorConfig.ZIPKIN_TRACE_ID_128BIT_ENABLED_DEFAULT); final Reporter<Span> reporter = buildReporter(map); final String localServiceName = getLocalServiceName(map); final Float samplerRate = getSamplerRate(map); final Tracing.Builder tracingBuilder = Tracing.newBuilder() .localServiceName(localServiceName) .traceId128Bit(traceId128bitEnabled) .sampler(Sampler.create(samplerRate)); if (reporter != null) { tracingBuilder.spanReporter(reporter); } tracing = tracingBuilder.build(); injector = tracing.propagation().injector(KafkaPropagation.HEADER_SETTER); extractor = tracing.propagation().extractor(KafkaPropagation.HEADER_GETTER); remoteServiceName = getRemoteServiceName(map); LOGGER.info("Zipkin Interceptor configured with local service name {} and " + "remote service name {}", localServiceName, remoteServiceName); }  @Override void configure(Map<String, ?> map);  }