From c47b63271beb3088ac611aa1923e3ce0dfb91627 Mon Sep 17 00:00:00 2001 From: Nate Hart Date: Thu, 15 Mar 2018 14:18:43 -0700 Subject: [PATCH] Updating the ReporterConfig to set Sender Correctly A small bug in the private getReporter(..) method was resulting in the sender always being set to the default UdpSender. This is because the field `senderConfiguration.sender` is null until the `getSender()` method is called on it. Because the reporter builder was accessing the field directly rather than through the getter, it was always UdpSen a null sender, thus defaulting to the UdpSender even if the JAEGER_ENDPOINT property was set. This commit fixes the problem, accessing the configured sender through the appropriate getter, allowing the user configurations to propagate through to the tracer retrieved via the `Configuration.fromEnv().getTracer()` method. Signed-off-by: Nate Hart --- jaeger-core/src/main/java/com/uber/jaeger/Configuration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jaeger-core/src/main/java/com/uber/jaeger/Configuration.java b/jaeger-core/src/main/java/com/uber/jaeger/Configuration.java index d047cccd3..9cb558641 100644 --- a/jaeger-core/src/main/java/com/uber/jaeger/Configuration.java +++ b/jaeger-core/src/main/java/com/uber/jaeger/Configuration.java @@ -570,7 +570,7 @@ public ReporterConfiguration withSender(SenderConfiguration senderConfiguration) private Reporter getReporter(Metrics metrics) { Reporter reporter = new RemoteReporter.Builder() .withMetrics(metrics) - .withSender(senderConfiguration.sender) + .withSender(senderConfiguration.getSender()) .withFlushInterval(numberOrDefault(this.flushIntervalMs, RemoteReporter.DEFAULT_FLUSH_INTERVAL_MS).intValue()) .withMaxQueueSize(numberOrDefault(this.maxQueueSize, RemoteReporter.DEFAULT_MAX_QUEUE_SIZE).intValue()) .build();