From 0410d68d38a1ca63f9bb79cdee25cfdcd8770d34 Mon Sep 17 00:00:00 2001 From: Qinfeng Chen Date: Tue, 31 Jul 2018 16:25:19 +0100 Subject: [PATCH] add tracing-api --- gradle/wrapper/gradle-wrapper.properties | 2 +- readme.md | 4 +- settings.gradle | 1 + tracing-api/build.gradle | 14 ++++ .../com/palantir/tracing/api/OpenSpan.java | 79 +++++++++++++++++++ .../java/com/palantir/tracing/api/Span.java | 53 +++++++++++++ .../palantir/tracing/api/SpanObserver.java | 25 ++++++ .../com/palantir/tracing/api/SpanType.java | 34 ++++++++ .../tracing/api/TraceHttpHeaders.java | 25 ++++++ tracing-api/versions.lock | 36 +++++++++ tracing-jaxrs/versions.lock | 32 ++++---- .../tracing/jersey/TraceEnrichingFilter.java | 6 +- .../jersey/TraceEnrichingFilterTest.java | 8 +- tracing-jersey/versions.lock | 32 ++++---- .../okhttp3/OkhttpTraceInterceptor.java | 6 +- .../okhttp3/OkhttpTraceInterceptorTest.java | 10 +-- tracing-okhttp3/versions.lock | 32 ++++---- tracing/build.gradle | 2 +- .../tracing/AsyncSlf4jSpanObserver.java | 2 +- .../palantir/tracing/AsyncSpanObserver.java | 4 +- .../com/palantir/tracing/CloseableTracer.java | 2 +- .../java/com/palantir/tracing/Observers.java | 4 +- .../main/java/com/palantir/tracing/Trace.java | 4 +- .../java/com/palantir/tracing/Tracer.java | 8 +- .../tracing/AsyncSlf4jSpanObserverTest.java | 4 +- .../tracing/AsyncSpanObserverTest.java | 6 +- .../java/com/palantir/tracing/TracerTest.java | 8 +- .../com/palantir/tracing/TracersTest.java | 2 +- tracing/versions.lock | 16 ++-- versions.props | 1 - 30 files changed, 364 insertions(+), 98 deletions(-) create mode 100644 tracing-api/build.gradle create mode 100644 tracing-api/src/main/java/com/palantir/tracing/api/OpenSpan.java create mode 100644 tracing-api/src/main/java/com/palantir/tracing/api/Span.java create mode 100644 tracing-api/src/main/java/com/palantir/tracing/api/SpanObserver.java create mode 100644 tracing-api/src/main/java/com/palantir/tracing/api/SpanType.java create mode 100644 tracing-api/src/main/java/com/palantir/tracing/api/TraceHttpHeaders.java create mode 100644 tracing-api/versions.lock diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a95009c3b..edc0bb11c 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.5-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/readme.md b/readme.md index 31e0a779e..8c548d9db 100644 --- a/readme.md +++ b/readme.md @@ -33,12 +33,12 @@ try { } ``` -The `tracing` library can be used independently of `conjure-java-jaxrs-client` or `conjure-java-retrofit2-client`: +Example of how to use the `tracing` library: ```groovy // build.gradle dependencies { - compile "com.palantir.conjure.java.runtime:tracing:$version" + compile "com.palantir.tracing:tracing:$version" } ``` ```java diff --git a/settings.gradle b/settings.gradle index 09ce96922..a165a6cf5 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,6 +1,7 @@ rootProject.name = 'tracing-java' include 'tracing' +include 'tracing-api' include 'tracing-jaxrs' include 'tracing-okhttp3' include 'tracing-jersey' diff --git a/tracing-api/build.gradle b/tracing-api/build.gradle new file mode 100644 index 000000000..d29891b17 --- /dev/null +++ b/tracing-api/build.gradle @@ -0,0 +1,14 @@ +apply plugin: "org.inferred.processors" + +apply from: "$rootDir/gradle/publish-jar.gradle" + +dependencies { + compile "com.fasterxml.jackson.core:jackson-databind" + + testCompile "junit:junit" + testCompile "org.assertj:assertj-core" + testCompile "org.mockito:mockito-core" + testCompile "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml" + + processor "org.immutables:value" +} diff --git a/tracing-api/src/main/java/com/palantir/tracing/api/OpenSpan.java b/tracing-api/src/main/java/com/palantir/tracing/api/OpenSpan.java new file mode 100644 index 000000000..e988fc03b --- /dev/null +++ b/tracing-api/src/main/java/com/palantir/tracing/api/OpenSpan.java @@ -0,0 +1,79 @@ +/* + * (c) Copyright 2018 Palantir Technologies Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.palantir.tracing.api; + +import java.util.Optional; +import org.immutables.value.Value; + +/** + * A value object represented an open (i.e., non-completed) span. Once completed, the span is represented by a {@link + * Span} object. + */ +@Value.Immutable +@Value.Style(visibility = Value.Style.ImplementationVisibility.PACKAGE) +public abstract class OpenSpan { + + /** + * Returns a description of the operation for this event. + */ + public abstract String getOperation(); + + /** + * Returns the start time in microseconds since epoch start of the span represented by this state. + *

+ * Users of this class should not set this value manually in the builder, it is configured automatically when using + * the {@link #builder()} static. + */ + public abstract long getStartTimeMicroSeconds(); + + /** + * Returns the starting clock position in nanoseconds for use in computing span duration. + *

+ * Users of this class should not set this value manually in the builder, it is configured automatically when using + * the {@link #builder()} static. + */ + public abstract long getStartClockNanoSeconds(); + + /** + * Returns the identifier of the parent span for the current span, if one exists. + */ + public abstract Optional getParentSpanId(); + + /** + * Returns a globally unique identifier representing a single span within the call trace. + */ + public abstract String getSpanId(); + + /** Indicates the {@link SpanType} of this span, e.g., a server-side vs. client-side vs local span. */ + public abstract SpanType type(); + + /** + * Indicates if this trace state was sampled public abstract boolean isSampled(); + *

+ * /** Returns a builder for {@link OpenSpan} pre-initialized to use the current time. + *

+ * Users should not set the {@code startTimeMs} value manually. + */ + public static Builder builder() { + return new Builder() + // TODO(rfink): Use direct access to system microseconds when moving to Java8 / Java9 + .startTimeMicroSeconds(System.currentTimeMillis() * 1000) + .startClockNanoSeconds(System.nanoTime()); + } + + public static class Builder extends ImmutableOpenSpan.Builder {} +} diff --git a/tracing-api/src/main/java/com/palantir/tracing/api/Span.java b/tracing-api/src/main/java/com/palantir/tracing/api/Span.java new file mode 100644 index 000000000..c55bbb097 --- /dev/null +++ b/tracing-api/src/main/java/com/palantir/tracing/api/Span.java @@ -0,0 +1,53 @@ +/* + * (c) Copyright 2018 Palantir Technologies Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.palantir.tracing.api; + +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import java.util.Map; +import java.util.Optional; +import org.immutables.value.Value; + +/** + * A value class representing a completed Span, see {@link OpenSpan} for a description of the fields. + */ +@JsonDeserialize(as = ImmutableSpan.class) +@JsonSerialize(as = ImmutableSpan.class) +@Value.Immutable +@Value.Style(visibility = Value.Style.ImplementationVisibility.PACKAGE) +public abstract class Span { + + public abstract String getTraceId(); + public abstract Optional getParentSpanId(); + public abstract String getSpanId(); + public abstract SpanType type(); + public abstract String getOperation(); + public abstract long getStartTimeMicroSeconds(); + public abstract long getDurationNanoSeconds(); + /** + * Returns a map of custom key-value metadata with which spans will be annotated. For example, a "userId" key could + * be added to associate spans with the requesting user. + */ + public abstract Map getMetadata(); + + public static Builder builder() { + return new Builder(); + } + + public static class Builder extends ImmutableSpan.Builder {} + +} diff --git a/tracing-api/src/main/java/com/palantir/tracing/api/SpanObserver.java b/tracing-api/src/main/java/com/palantir/tracing/api/SpanObserver.java new file mode 100644 index 000000000..f4b7203c6 --- /dev/null +++ b/tracing-api/src/main/java/com/palantir/tracing/api/SpanObserver.java @@ -0,0 +1,25 @@ +/* + * (c) Copyright 2018 Palantir Technologies Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.palantir.tracing.api; + +/** + * Represents the event receiver for span completion events. Implementations are invoked synchronously on the primary + * execution thread, and as a result must execute quickly. + */ +public interface SpanObserver { + void consume(Span span); +} diff --git a/tracing-api/src/main/java/com/palantir/tracing/api/SpanType.java b/tracing-api/src/main/java/com/palantir/tracing/api/SpanType.java new file mode 100644 index 000000000..a8fb89033 --- /dev/null +++ b/tracing-api/src/main/java/com/palantir/tracing/api/SpanType.java @@ -0,0 +1,34 @@ +/* + * (c) Copyright 2018 Palantir Technologies Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.palantir.tracing.api; + +public enum SpanType { + /** + * Indicates that this span encapsulates server-side work of an RPC call. This is typically the outermost span of a + * set of calls made within one service as a result of an incoming RPC call. + */ + SERVER_INCOMING, + + /** + * Indicates that this is the innermost span encapsulating remote work, typically the last span opened by an RPC + * client. + */ + CLIENT_OUTGOING, + + /** Indicates a local method call or computation that does not involve RPC. */ + LOCAL +} diff --git a/tracing-api/src/main/java/com/palantir/tracing/api/TraceHttpHeaders.java b/tracing-api/src/main/java/com/palantir/tracing/api/TraceHttpHeaders.java new file mode 100644 index 000000000..8c500ab95 --- /dev/null +++ b/tracing-api/src/main/java/com/palantir/tracing/api/TraceHttpHeaders.java @@ -0,0 +1,25 @@ +/* + * (c) Copyright 2018 Palantir Technologies Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.palantir.tracing.api; + +/** Zipkin-compatible HTTP header names. */ +public interface TraceHttpHeaders { + String TRACE_ID = "X-B3-TraceId"; + String PARENT_SPAN_ID = "X-B3-ParentSpanId"; + String SPAN_ID = "X-B3-SpanId"; + String IS_SAMPLED = "X-B3-Sampled"; +} diff --git a/tracing-api/versions.lock b/tracing-api/versions.lock new file mode 100644 index 000000000..e579ddc20 --- /dev/null +++ b/tracing-api/versions.lock @@ -0,0 +1,36 @@ +{ + "compileClasspath": { + "com.fasterxml.jackson.core:jackson-annotations": { + "locked": "2.9.5", + "transitive": [ + "com.fasterxml.jackson.core:jackson-databind" + ] + }, + "com.fasterxml.jackson.core:jackson-core": { + "locked": "2.9.5", + "transitive": [ + "com.fasterxml.jackson.core:jackson-databind" + ] + }, + "com.fasterxml.jackson.core:jackson-databind": { + "locked": "2.9.5" + } + }, + "runtime": { + "com.fasterxml.jackson.core:jackson-annotations": { + "locked": "2.9.5", + "transitive": [ + "com.fasterxml.jackson.core:jackson-databind" + ] + }, + "com.fasterxml.jackson.core:jackson-core": { + "locked": "2.9.5", + "transitive": [ + "com.fasterxml.jackson.core:jackson-databind" + ] + }, + "com.fasterxml.jackson.core:jackson-databind": { + "locked": "2.9.5" + } + } +} \ No newline at end of file diff --git a/tracing-jaxrs/versions.lock b/tracing-jaxrs/versions.lock index 166b7fff1..00bb325e0 100644 --- a/tracing-jaxrs/versions.lock +++ b/tracing-jaxrs/versions.lock @@ -21,8 +21,8 @@ "com.fasterxml.jackson.datatype:jackson-datatype-guava", "com.fasterxml.jackson.datatype:jackson-datatype-jdk8", "com.fasterxml.jackson.module:jackson-module-afterburner", - "com.palantir.conjure.java.api:tracing", - "com.palantir.tracing:tracing" + "com.palantir.tracing:tracing", + "com.palantir.tracing:tracing-api" ] }, "com.fasterxml.jackson.datatype:jackson-datatype-guava": { @@ -50,12 +50,6 @@ "com.palantir.tracing:tracing" ] }, - "com.palantir.conjure.java.api:tracing": { - "locked": "2.0.0-rc3", - "transitive": [ - "com.palantir.tracing:tracing" - ] - }, "com.palantir.safe-logging:safe-logging": { "locked": "1.3.0", "transitive": [ @@ -65,6 +59,12 @@ "com.palantir.tracing:tracing": { "project": true }, + "com.palantir.tracing:tracing-api": { + "project": true, + "transitive": [ + "com.palantir.tracing:tracing" + ] + }, "javax.ws.rs:javax.ws.rs-api": { "locked": "2.0.1" }, @@ -97,8 +97,8 @@ "com.fasterxml.jackson.datatype:jackson-datatype-guava", "com.fasterxml.jackson.datatype:jackson-datatype-jdk8", "com.fasterxml.jackson.module:jackson-module-afterburner", - "com.palantir.conjure.java.api:tracing", - "com.palantir.tracing:tracing" + "com.palantir.tracing:tracing", + "com.palantir.tracing:tracing-api" ] }, "com.fasterxml.jackson.datatype:jackson-datatype-guava": { @@ -126,12 +126,6 @@ "com.palantir.tracing:tracing" ] }, - "com.palantir.conjure.java.api:tracing": { - "locked": "2.0.0-rc3", - "transitive": [ - "com.palantir.tracing:tracing" - ] - }, "com.palantir.safe-logging:safe-logging": { "locked": "1.3.0", "transitive": [ @@ -141,6 +135,12 @@ "com.palantir.tracing:tracing": { "project": true }, + "com.palantir.tracing:tracing-api": { + "project": true, + "transitive": [ + "com.palantir.tracing:tracing" + ] + }, "javax.ws.rs:javax.ws.rs-api": { "locked": "2.0.1" }, diff --git a/tracing-jersey/src/main/java/com/palantir/tracing/jersey/TraceEnrichingFilter.java b/tracing-jersey/src/main/java/com/palantir/tracing/jersey/TraceEnrichingFilter.java index 8bdd8d8b7..2b75e4ce9 100644 --- a/tracing-jersey/src/main/java/com/palantir/tracing/jersey/TraceEnrichingFilter.java +++ b/tracing-jersey/src/main/java/com/palantir/tracing/jersey/TraceEnrichingFilter.java @@ -17,11 +17,11 @@ package com.palantir.tracing.jersey; import com.google.common.base.Strings; -import com.palantir.conjure.java.api.tracing.Span; -import com.palantir.conjure.java.api.tracing.SpanType; -import com.palantir.conjure.java.api.tracing.TraceHttpHeaders; import com.palantir.tracing.Tracer; import com.palantir.tracing.Tracers; +import com.palantir.tracing.api.Span; +import com.palantir.tracing.api.SpanType; +import com.palantir.tracing.api.TraceHttpHeaders; import java.io.IOException; import java.util.Optional; import javax.ws.rs.container.ContainerRequestContext; diff --git a/tracing-jersey/src/test/java/com/palantir/tracing/jersey/TraceEnrichingFilterTest.java b/tracing-jersey/src/test/java/com/palantir/tracing/jersey/TraceEnrichingFilterTest.java index 983321626..bece9cb91 100644 --- a/tracing-jersey/src/test/java/com/palantir/tracing/jersey/TraceEnrichingFilterTest.java +++ b/tracing-jersey/src/test/java/com/palantir/tracing/jersey/TraceEnrichingFilterTest.java @@ -27,13 +27,13 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import com.palantir.conjure.java.api.tracing.Span; -import com.palantir.conjure.java.api.tracing.SpanObserver; -import com.palantir.conjure.java.api.tracing.SpanType; -import com.palantir.conjure.java.api.tracing.TraceHttpHeaders; import com.palantir.tracing.TraceSampler; import com.palantir.tracing.Tracer; import com.palantir.tracing.Tracers; +import com.palantir.tracing.api.Span; +import com.palantir.tracing.api.SpanObserver; +import com.palantir.tracing.api.SpanType; +import com.palantir.tracing.api.TraceHttpHeaders; import io.dropwizard.Application; import io.dropwizard.Configuration; import io.dropwizard.setup.Environment; diff --git a/tracing-jersey/versions.lock b/tracing-jersey/versions.lock index d0d734953..7437af186 100644 --- a/tracing-jersey/versions.lock +++ b/tracing-jersey/versions.lock @@ -21,8 +21,8 @@ "com.fasterxml.jackson.datatype:jackson-datatype-guava", "com.fasterxml.jackson.datatype:jackson-datatype-jdk8", "com.fasterxml.jackson.module:jackson-module-afterburner", - "com.palantir.conjure.java.api:tracing", - "com.palantir.tracing:tracing" + "com.palantir.tracing:tracing", + "com.palantir.tracing:tracing-api" ] }, "com.fasterxml.jackson.datatype:jackson-datatype-guava": { @@ -50,12 +50,6 @@ "com.palantir.tracing:tracing" ] }, - "com.palantir.conjure.java.api:tracing": { - "locked": "2.0.0-rc3", - "transitive": [ - "com.palantir.tracing:tracing" - ] - }, "com.palantir.safe-logging:safe-logging": { "locked": "1.3.0", "transitive": [ @@ -65,6 +59,12 @@ "com.palantir.tracing:tracing": { "project": true }, + "com.palantir.tracing:tracing-api": { + "project": true, + "transitive": [ + "com.palantir.tracing:tracing" + ] + }, "javax.annotation:javax.annotation-api": { "locked": "1.2", "transitive": [ @@ -207,8 +207,8 @@ "com.fasterxml.jackson.datatype:jackson-datatype-guava", "com.fasterxml.jackson.datatype:jackson-datatype-jdk8", "com.fasterxml.jackson.module:jackson-module-afterburner", - "com.palantir.conjure.java.api:tracing", - "com.palantir.tracing:tracing" + "com.palantir.tracing:tracing", + "com.palantir.tracing:tracing-api" ] }, "com.fasterxml.jackson.datatype:jackson-datatype-guava": { @@ -236,12 +236,6 @@ "com.palantir.tracing:tracing" ] }, - "com.palantir.conjure.java.api:tracing": { - "locked": "2.0.0-rc3", - "transitive": [ - "com.palantir.tracing:tracing" - ] - }, "com.palantir.safe-logging:safe-logging": { "locked": "1.3.0", "transitive": [ @@ -251,6 +245,12 @@ "com.palantir.tracing:tracing": { "project": true }, + "com.palantir.tracing:tracing-api": { + "project": true, + "transitive": [ + "com.palantir.tracing:tracing" + ] + }, "javax.annotation:javax.annotation-api": { "locked": "1.2", "transitive": [ diff --git a/tracing-okhttp3/src/main/java/com/palantir/tracing/okhttp3/OkhttpTraceInterceptor.java b/tracing-okhttp3/src/main/java/com/palantir/tracing/okhttp3/OkhttpTraceInterceptor.java index 51538e1c5..e66d27fcc 100644 --- a/tracing-okhttp3/src/main/java/com/palantir/tracing/okhttp3/OkhttpTraceInterceptor.java +++ b/tracing-okhttp3/src/main/java/com/palantir/tracing/okhttp3/OkhttpTraceInterceptor.java @@ -16,10 +16,10 @@ package com.palantir.tracing.okhttp3; -import com.palantir.conjure.java.api.tracing.OpenSpan; -import com.palantir.conjure.java.api.tracing.SpanType; -import com.palantir.conjure.java.api.tracing.TraceHttpHeaders; import com.palantir.tracing.Tracer; +import com.palantir.tracing.api.OpenSpan; +import com.palantir.tracing.api.SpanType; +import com.palantir.tracing.api.TraceHttpHeaders; import java.io.IOException; import okhttp3.Interceptor; import okhttp3.Request; diff --git a/tracing-okhttp3/src/test/java/com/palantir/tracing/okhttp3/OkhttpTraceInterceptorTest.java b/tracing-okhttp3/src/test/java/com/palantir/tracing/okhttp3/OkhttpTraceInterceptorTest.java index 044b700ee..f684eb91d 100644 --- a/tracing-okhttp3/src/test/java/com/palantir/tracing/okhttp3/OkhttpTraceInterceptorTest.java +++ b/tracing-okhttp3/src/test/java/com/palantir/tracing/okhttp3/OkhttpTraceInterceptorTest.java @@ -22,13 +22,13 @@ import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.when; -import com.palantir.conjure.java.api.tracing.OpenSpan; -import com.palantir.conjure.java.api.tracing.Span; -import com.palantir.conjure.java.api.tracing.SpanObserver; -import com.palantir.conjure.java.api.tracing.SpanType; -import com.palantir.conjure.java.api.tracing.TraceHttpHeaders; import com.palantir.tracing.Tracer; import com.palantir.tracing.Tracers; +import com.palantir.tracing.api.OpenSpan; +import com.palantir.tracing.api.Span; +import com.palantir.tracing.api.SpanObserver; +import com.palantir.tracing.api.SpanType; +import com.palantir.tracing.api.TraceHttpHeaders; import java.io.IOException; import java.util.Optional; import okhttp3.Interceptor; diff --git a/tracing-okhttp3/versions.lock b/tracing-okhttp3/versions.lock index 7a96df290..3cba80d37 100644 --- a/tracing-okhttp3/versions.lock +++ b/tracing-okhttp3/versions.lock @@ -21,8 +21,8 @@ "com.fasterxml.jackson.datatype:jackson-datatype-guava", "com.fasterxml.jackson.datatype:jackson-datatype-jdk8", "com.fasterxml.jackson.module:jackson-module-afterburner", - "com.palantir.conjure.java.api:tracing", - "com.palantir.tracing:tracing" + "com.palantir.tracing:tracing", + "com.palantir.tracing:tracing-api" ] }, "com.fasterxml.jackson.datatype:jackson-datatype-guava": { @@ -50,12 +50,6 @@ "com.palantir.tracing:tracing" ] }, - "com.palantir.conjure.java.api:tracing": { - "locked": "2.0.0-rc3", - "transitive": [ - "com.palantir.tracing:tracing" - ] - }, "com.palantir.safe-logging:safe-logging": { "locked": "1.3.0", "transitive": [ @@ -65,6 +59,12 @@ "com.palantir.tracing:tracing": { "project": true }, + "com.palantir.tracing:tracing-api": { + "project": true, + "transitive": [ + "com.palantir.tracing:tracing" + ] + }, "com.squareup.okhttp3:okhttp": { "locked": "3.9.0" }, @@ -103,8 +103,8 @@ "com.fasterxml.jackson.datatype:jackson-datatype-guava", "com.fasterxml.jackson.datatype:jackson-datatype-jdk8", "com.fasterxml.jackson.module:jackson-module-afterburner", - "com.palantir.conjure.java.api:tracing", - "com.palantir.tracing:tracing" + "com.palantir.tracing:tracing", + "com.palantir.tracing:tracing-api" ] }, "com.fasterxml.jackson.datatype:jackson-datatype-guava": { @@ -132,12 +132,6 @@ "com.palantir.tracing:tracing" ] }, - "com.palantir.conjure.java.api:tracing": { - "locked": "2.0.0-rc3", - "transitive": [ - "com.palantir.tracing:tracing" - ] - }, "com.palantir.safe-logging:safe-logging": { "locked": "1.3.0", "transitive": [ @@ -147,6 +141,12 @@ "com.palantir.tracing:tracing": { "project": true }, + "com.palantir.tracing:tracing-api": { + "project": true, + "transitive": [ + "com.palantir.tracing:tracing" + ] + }, "com.squareup.okhttp3:okhttp": { "locked": "3.9.0" }, diff --git a/tracing/build.gradle b/tracing/build.gradle index da3fcc867..a1315e6cd 100644 --- a/tracing/build.gradle +++ b/tracing/build.gradle @@ -19,12 +19,12 @@ apply plugin: 'org.inferred.processors' apply from: "${rootDir}/gradle/publish-jar.gradle" dependencies { + compile project(":tracing-api") compile "com.fasterxml.jackson.core:jackson-databind" compile "com.fasterxml.jackson.datatype:jackson-datatype-guava" compile "com.fasterxml.jackson.datatype:jackson-datatype-jdk8" compile "com.fasterxml.jackson.module:jackson-module-afterburner" compile "com.google.guava:guava" - compile "com.palantir.conjure.java.api:tracing" compile "com.palantir.safe-logging:safe-logging" compile "org.slf4j:slf4j-api" diff --git a/tracing/src/main/java/com/palantir/tracing/AsyncSlf4jSpanObserver.java b/tracing/src/main/java/com/palantir/tracing/AsyncSlf4jSpanObserver.java index 534496761..bd1ddbc89 100644 --- a/tracing/src/main/java/com/palantir/tracing/AsyncSlf4jSpanObserver.java +++ b/tracing/src/main/java/com/palantir/tracing/AsyncSlf4jSpanObserver.java @@ -26,8 +26,8 @@ import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; import com.fasterxml.jackson.module.afterburner.AfterburnerModule; import com.google.common.collect.Lists; -import com.palantir.conjure.java.api.tracing.Span; import com.palantir.logsafe.UnsafeArg; +import com.palantir.tracing.api.Span; import java.net.Inet4Address; import java.net.Inet6Address; import java.net.InetAddress; diff --git a/tracing/src/main/java/com/palantir/tracing/AsyncSpanObserver.java b/tracing/src/main/java/com/palantir/tracing/AsyncSpanObserver.java index fde7f8d07..c5b948aef 100644 --- a/tracing/src/main/java/com/palantir/tracing/AsyncSpanObserver.java +++ b/tracing/src/main/java/com/palantir/tracing/AsyncSpanObserver.java @@ -21,9 +21,9 @@ import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListeningExecutorService; import com.google.common.util.concurrent.MoreExecutors; -import com.palantir.conjure.java.api.tracing.Span; -import com.palantir.conjure.java.api.tracing.SpanObserver; import com.palantir.logsafe.SafeArg; +import com.palantir.tracing.api.Span; +import com.palantir.tracing.api.SpanObserver; import java.util.concurrent.ExecutorService; import java.util.concurrent.atomic.AtomicInteger; import org.slf4j.Logger; diff --git a/tracing/src/main/java/com/palantir/tracing/CloseableTracer.java b/tracing/src/main/java/com/palantir/tracing/CloseableTracer.java index e37c9e368..bf301287c 100644 --- a/tracing/src/main/java/com/palantir/tracing/CloseableTracer.java +++ b/tracing/src/main/java/com/palantir/tracing/CloseableTracer.java @@ -16,7 +16,7 @@ package com.palantir.tracing; -import com.palantir.conjure.java.api.tracing.SpanType; +import com.palantir.tracing.api.SpanType; /** * Wraps the {@link Tracer} methods in a closeable resource to enable the usage of the try-with-resources pattern. diff --git a/tracing/src/main/java/com/palantir/tracing/Observers.java b/tracing/src/main/java/com/palantir/tracing/Observers.java index 65dc9f67e..73a7afec7 100644 --- a/tracing/src/main/java/com/palantir/tracing/Observers.java +++ b/tracing/src/main/java/com/palantir/tracing/Observers.java @@ -16,8 +16,8 @@ package com.palantir.tracing; -import com.palantir.conjure.java.api.tracing.Span; -import com.palantir.conjure.java.api.tracing.SpanObserver; +import com.palantir.tracing.api.Span; +import com.palantir.tracing.api.SpanObserver; import java.util.concurrent.ExecutorService; public final class Observers { diff --git a/tracing/src/main/java/com/palantir/tracing/Trace.java b/tracing/src/main/java/com/palantir/tracing/Trace.java index bb283116e..57e5cef12 100644 --- a/tracing/src/main/java/com/palantir/tracing/Trace.java +++ b/tracing/src/main/java/com/palantir/tracing/Trace.java @@ -18,8 +18,8 @@ import static com.google.common.base.Preconditions.checkArgument; -import com.palantir.conjure.java.api.tracing.OpenSpan; -import com.palantir.conjure.java.api.tracing.SpanObserver; +import com.palantir.tracing.api.OpenSpan; +import com.palantir.tracing.api.SpanObserver; import java.util.ArrayDeque; import java.util.Deque; import java.util.Optional; diff --git a/tracing/src/main/java/com/palantir/tracing/Tracer.java b/tracing/src/main/java/com/palantir/tracing/Tracer.java index 5c32b7603..77ead25bb 100644 --- a/tracing/src/main/java/com/palantir/tracing/Tracer.java +++ b/tracing/src/main/java/com/palantir/tracing/Tracer.java @@ -18,12 +18,12 @@ import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; -import com.palantir.conjure.java.api.tracing.OpenSpan; -import com.palantir.conjure.java.api.tracing.Span; -import com.palantir.conjure.java.api.tracing.SpanObserver; -import com.palantir.conjure.java.api.tracing.SpanType; import com.palantir.logsafe.SafeArg; import com.palantir.logsafe.UnsafeArg; +import com.palantir.tracing.api.OpenSpan; +import com.palantir.tracing.api.Span; +import com.palantir.tracing.api.SpanObserver; +import com.palantir.tracing.api.SpanType; import java.util.Collections; import java.util.HashMap; import java.util.List; diff --git a/tracing/src/test/java/com/palantir/tracing/AsyncSlf4jSpanObserverTest.java b/tracing/src/test/java/com/palantir/tracing/AsyncSlf4jSpanObserverTest.java index 46b823630..f1cd388fb 100644 --- a/tracing/src/test/java/com/palantir/tracing/AsyncSlf4jSpanObserverTest.java +++ b/tracing/src/test/java/com/palantir/tracing/AsyncSlf4jSpanObserverTest.java @@ -33,8 +33,8 @@ // CHECKSTYLE:ON import com.google.common.collect.ImmutableMap; -import com.palantir.conjure.java.api.tracing.Span; -import com.palantir.conjure.java.api.tracing.SpanType; +import com.palantir.tracing.api.Span; +import com.palantir.tracing.api.SpanType; import java.net.Inet4Address; import java.net.Inet6Address; import java.net.InetAddress; diff --git a/tracing/src/test/java/com/palantir/tracing/AsyncSpanObserverTest.java b/tracing/src/test/java/com/palantir/tracing/AsyncSpanObserverTest.java index 38c6d0a19..9dcaa1bb2 100644 --- a/tracing/src/test/java/com/palantir/tracing/AsyncSpanObserverTest.java +++ b/tracing/src/test/java/com/palantir/tracing/AsyncSpanObserverTest.java @@ -21,9 +21,9 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoMoreInteractions; -import com.palantir.conjure.java.api.tracing.Span; -import com.palantir.conjure.java.api.tracing.SpanObserver; -import com.palantir.conjure.java.api.tracing.SpanType; +import com.palantir.tracing.api.Span; +import com.palantir.tracing.api.SpanObserver; +import com.palantir.tracing.api.SpanType; import org.jmock.lib.concurrent.DeterministicScheduler; import org.junit.Before; import org.junit.Test; diff --git a/tracing/src/test/java/com/palantir/tracing/TracerTest.java b/tracing/src/test/java/com/palantir/tracing/TracerTest.java index b729b0264..71ff22d76 100644 --- a/tracing/src/test/java/com/palantir/tracing/TracerTest.java +++ b/tracing/src/test/java/com/palantir/tracing/TracerTest.java @@ -25,10 +25,10 @@ import static org.mockito.Mockito.when; import com.google.common.collect.ImmutableMap; -import com.palantir.conjure.java.api.tracing.OpenSpan; -import com.palantir.conjure.java.api.tracing.Span; -import com.palantir.conjure.java.api.tracing.SpanObserver; -import com.palantir.conjure.java.api.tracing.SpanType; +import com.palantir.tracing.api.OpenSpan; +import com.palantir.tracing.api.Span; +import com.palantir.tracing.api.SpanObserver; +import com.palantir.tracing.api.SpanType; import java.util.Map; import java.util.Optional; import org.junit.After; diff --git a/tracing/src/test/java/com/palantir/tracing/TracersTest.java b/tracing/src/test/java/com/palantir/tracing/TracersTest.java index a37374547..79c71bb6a 100644 --- a/tracing/src/test/java/com/palantir/tracing/TracersTest.java +++ b/tracing/src/test/java/com/palantir/tracing/TracersTest.java @@ -20,7 +20,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import com.google.common.collect.Lists; -import com.palantir.conjure.java.api.tracing.OpenSpan; +import com.palantir.tracing.api.OpenSpan; import java.util.HashSet; import java.util.List; import java.util.Set; diff --git a/tracing/versions.lock b/tracing/versions.lock index a0fe1db02..b8c8d670f 100644 --- a/tracing/versions.lock +++ b/tracing/versions.lock @@ -21,7 +21,7 @@ "com.fasterxml.jackson.datatype:jackson-datatype-guava", "com.fasterxml.jackson.datatype:jackson-datatype-jdk8", "com.fasterxml.jackson.module:jackson-module-afterburner", - "com.palantir.conjure.java.api:tracing" + "com.palantir.tracing:tracing-api" ] }, "com.fasterxml.jackson.datatype:jackson-datatype-guava": { @@ -39,12 +39,12 @@ "com.fasterxml.jackson.datatype:jackson-datatype-guava" ] }, - "com.palantir.conjure.java.api:tracing": { - "locked": "2.0.0-rc3" - }, "com.palantir.safe-logging:safe-logging": { "locked": "1.3.0" }, + "com.palantir.tracing:tracing-api": { + "project": true + }, "org.slf4j:slf4j-api": { "locked": "1.7.12" } @@ -71,7 +71,7 @@ "com.fasterxml.jackson.datatype:jackson-datatype-guava", "com.fasterxml.jackson.datatype:jackson-datatype-jdk8", "com.fasterxml.jackson.module:jackson-module-afterburner", - "com.palantir.conjure.java.api:tracing" + "com.palantir.tracing:tracing-api" ] }, "com.fasterxml.jackson.datatype:jackson-datatype-guava": { @@ -89,12 +89,12 @@ "com.fasterxml.jackson.datatype:jackson-datatype-guava" ] }, - "com.palantir.conjure.java.api:tracing": { - "locked": "2.0.0-rc3" - }, "com.palantir.safe-logging:safe-logging": { "locked": "1.3.0" }, + "com.palantir.tracing:tracing-api": { + "project": true + }, "org.slf4j:slf4j-api": { "locked": "1.7.12" } diff --git a/versions.props b/versions.props index 518e06e25..2a2d62a93 100644 --- a/versions.props +++ b/versions.props @@ -1,7 +1,6 @@ ch.qos.logback:logback-classic = 1.1.7 com.fasterxml.jackson.*:jackson-* = 2.9.5 com.google.guava:guava = 20.0 -com.palantir.conjure.java.api:* = 2.0.0-rc3 com.palantir.safe-logging:* = 1.3.0 com.squareup.okhttp3:okhttp = 3.9.0 io.dropwizard:dropwizard-* = 1.3.1