diff --git a/jaeger-core/src/main/java/io/jaegertracing/baggage/RemoteBaggageRestrictionManager.java b/jaeger-core/src/main/java/io/jaegertracing/baggage/RemoteBaggageRestrictionManager.java index e6d5a65d5..87e2ab9fb 100644 --- a/jaeger-core/src/main/java/io/jaegertracing/baggage/RemoteBaggageRestrictionManager.java +++ b/jaeger-core/src/main/java/io/jaegertracing/baggage/RemoteBaggageRestrictionManager.java @@ -41,34 +41,7 @@ public class RemoteBaggageRestrictionManager implements BaggageRestrictionManage private final Restriction invalidRestriction; private final Restriction validRestriction; - /** - * @deprecated use {@link Builder} - */ - @Deprecated - public RemoteBaggageRestrictionManager( - String serviceName, - BaggageRestrictionManagerProxy proxy, - Metrics metrics, - boolean denyBaggageOnInitializationFailure - ) { - this(serviceName, proxy, metrics, denyBaggageOnInitializationFailure, DEFAULT_REFRESH_INTERVAL_MS); - } - - /** - * @deprecated use {@link Builder} - */ - @Deprecated - public RemoteBaggageRestrictionManager( - String serviceName, - BaggageRestrictionManagerProxy proxy, - Metrics metrics, - boolean denyBaggageOnInitializationFailure, - int refreshIntervalMs - ) { - this(serviceName, proxy, metrics, denyBaggageOnInitializationFailure, refreshIntervalMs, DEFAULT_INITIAL_DELAY_MS); - } - - private RemoteBaggageRestrictionManager( + protected RemoteBaggageRestrictionManager( String serviceName, BaggageRestrictionManagerProxy proxy, Metrics metrics, diff --git a/jaeger-core/src/main/java/io/jaegertracing/senders/HttpSender.java b/jaeger-core/src/main/java/io/jaegertracing/senders/HttpSender.java index 5d0919cbb..08ead00f3 100644 --- a/jaeger-core/src/main/java/io/jaegertracing/senders/HttpSender.java +++ b/jaeger-core/src/main/java/io/jaegertracing/senders/HttpSender.java @@ -38,20 +38,7 @@ public class HttpSender extends ThriftSender { private final OkHttpClient httpClient; private final Request.Builder requestBuilder; - /** - * @param endpoint Jaeger REST endpoint consuming jaeger.thrift, e.g - * http://localhost:14268/api/traces - * - * Uses the default {@link okhttp3.OkHttpClient} which uses {@link okhttp3.ConnectionPool#ConnectionPool()}. - * Use {@link HttpSender.Builder} if you need to add more parameters - * @deprecated use {@link Builder} - */ - @Deprecated - public HttpSender(String endpoint) { - this(new Builder(endpoint)); - } - - private HttpSender(Builder builder) { + protected HttpSender(Builder builder) { super(ProtocolType.Binary, builder.maxPacketSize); HttpUrl collectorUrl = HttpUrl .parse(String.format("%s?%s", builder.endpoint, HTTP_COLLECTOR_JAEGER_THRIFT_FORMAT_PARAM)); diff --git a/jaeger-core/src/test/java/io/jaegertracing/ConfigurationTest.java b/jaeger-core/src/test/java/io/jaegertracing/ConfigurationTest.java index a2148efae..15c935897 100644 --- a/jaeger-core/src/test/java/io/jaegertracing/ConfigurationTest.java +++ b/jaeger-core/src/test/java/io/jaegertracing/ConfigurationTest.java @@ -460,17 +460,4 @@ public String get(String key) { return values.get(key); } } - - private static class CustomSender extends HttpSender { - private String endpoint; - - public CustomSender(String endpoint) { - super(endpoint); - this.endpoint = endpoint; - } - - public String getEndpoint() { - return endpoint; - } - } } diff --git a/jaeger-core/src/test/java/io/jaegertracing/senders/HttpSenderTest.java b/jaeger-core/src/test/java/io/jaegertracing/senders/HttpSenderTest.java index 0ee35ae64..8d1c119b4 100644 --- a/jaeger-core/src/test/java/io/jaegertracing/senders/HttpSenderTest.java +++ b/jaeger-core/src/test/java/io/jaegertracing/senders/HttpSenderTest.java @@ -61,7 +61,8 @@ protected Application configure() { @Test public void sendHappy() throws Exception { - new HttpSender(target("/api/traces").getUri().toString()) + new HttpSender.Builder(target("/api/traces").getUri().toString()) + .build() .send(new Process("robotrock"), generateSpans()); new HttpSender.Builder(target("/api/traces").getUri().toString()).withMaxPacketSize(6500).build() .send(new Process("name"), generateSpans()); @@ -72,24 +73,27 @@ public void sendHappy() throws Exception { @Test(expected = Exception.class) public void sendServerError() throws Exception { - HttpSender sender = new HttpSender(target("/api/tracesErr").getUri().toString()); + HttpSender sender = new HttpSender.Builder(target("/api/tracesErr").getUri().toString()) + .build(); sender.send(new Process("robotrock"), generateSpans()); } @Test(expected = IllegalArgumentException.class) public void misconfiguredUrl() throws Exception { - new HttpSender("misconfiguredUrl"); + new HttpSender.Builder("misconfiguredUrl").build(); } @Test(expected = Exception.class) public void serverDoesntExist() throws Exception { - HttpSender sender = new HttpSender("http://some-server/api/traces"); + HttpSender sender = new HttpSender.Builder("http://some-server/api/traces") + .build(); sender.send(new Process("robotrock"), generateSpans()); } @Test(expected = SenderException.class) public void senderFail() throws Exception { - HttpSender sender = new HttpSender("http://some-server/api/traces"); + HttpSender sender = new HttpSender.Builder("http://some-server/api/traces") + .build(); sender.send(null, generateSpans()); } diff --git a/jaeger-crossdock/src/main/java/io/jaegertracing/crossdock/JerseyServer.java b/jaeger-crossdock/src/main/java/io/jaegertracing/crossdock/JerseyServer.java index 24a14a5b0..06794daf0 100644 --- a/jaeger-crossdock/src/main/java/io/jaegertracing/crossdock/JerseyServer.java +++ b/jaeger-crossdock/src/main/java/io/jaegertracing/crossdock/JerseyServer.java @@ -144,7 +144,8 @@ private static String getEvn(String envName, String defaultValue) { private static Sender senderFromEnv(String collectorHostPort, String agentHost) { String senderEnvVar = System.getenv(Constants.ENV_PROP_SENDER_TYPE); if ("http".equalsIgnoreCase(senderEnvVar)) { - return new HttpSender(String.format("http://%s/api/traces", collectorHostPort)); + return new HttpSender.Builder(String.format("http://%s/api/traces", collectorHostPort)) + .build(); } else if ("udp".equalsIgnoreCase(senderEnvVar) || senderEnvVar == null || senderEnvVar.isEmpty()) { return new UdpSender(agentHost, 0, 0); }