Skip to content

Commit

Permalink
Revert "Temporarily revert brave 6 change"
Browse files Browse the repository at this point in the history
This reverts commit 5c977a2.
  • Loading branch information
Adrian Cole committed Jan 8, 2024
1 parent 39b76ff commit cf8dbf9
Show file tree
Hide file tree
Showing 365 changed files with 516 additions and 19,044 deletions.
38 changes: 1 addition & 37 deletions brave-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<groupId>io.zipkin.brave</groupId>
<artifactId>brave-bom</artifactId>
<version>5.18.2-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<name>Brave BOM</name>
<description>Bill Of Materials POM for all Brave artifacts</description>
<packaging>pom</packaging>
Expand All @@ -32,10 +32,6 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<main.basedir>${project.basedir}/..</main.basedir>

<!-- use the same values in ../pom.xml -->
<zipkin.version>2.27.0</zipkin.version>
<zipkin-reporter.version>2.17.2</zipkin-reporter.version>
</properties>

<organization>
Expand Down Expand Up @@ -85,18 +81,6 @@

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.zipkin.reporter2</groupId>
<artifactId>zipkin-reporter-bom</artifactId>
<version>${zipkin-reporter.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>io.zipkin.zipkin2</groupId>
<artifactId>zipkin</artifactId>
<version>${zipkin.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>brave</artifactId>
Expand Down Expand Up @@ -127,11 +111,6 @@
<artifactId>brave-context-slf4j</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>brave-context-rxjava2</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>brave-instrumentation-benchmarks</artifactId>
Expand All @@ -142,11 +121,6 @@
<artifactId>brave-instrumentation-dubbo</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>brave-instrumentation-dubbo-rpc</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>brave-instrumentation-grpc</artifactId>
Expand Down Expand Up @@ -252,11 +226,6 @@
<artifactId>brave-instrumentation-okhttp3</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>brave-instrumentation-p6spy</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>brave-instrumentation-rpc</artifactId>
Expand All @@ -272,11 +241,6 @@
<artifactId>brave-instrumentation-servlet-jakarta</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>brave-instrumentation-sparkjava</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>brave-instrumentation-spring-rabbit</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion brave-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<parent>
<groupId>io.zipkin.brave</groupId>
<artifactId>brave-parent</artifactId>
<version>5.18.2-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ protected void is_inheritable(CurrentTraceContext inheritableCurrentTraceContext
}

@Test void restoresSpanAfterCallable() throws Exception {
try (Scope scope0 = currentTraceContext.newScope(context)) {
try (Scope scope = currentTraceContext.newScope(context)) {
attachesSpanInCallable();
assertThat(currentTraceContext.get())
.isEqualTo(context);
Expand Down Expand Up @@ -341,7 +341,7 @@ protected void is_inheritable(CurrentTraceContext inheritableCurrentTraceContext
@Test void restoresSpanAfterRunnable() throws Exception {
TraceContext context0 = TraceContext.newBuilder().traceId(3L).spanId(3L).build();

try (Scope scope0 = currentTraceContext.newScope(context0)) {
try (Scope scope = currentTraceContext.newScope(context0)) {
attachesSpanInRunnable();
assertThat(currentTraceContext.get())
.isEqualTo(context0);
Expand All @@ -366,7 +366,7 @@ static class Unused extends ClassLoaders.ConsumerRunnable<CurrentTraceContext.Bu
static class ClosedScope extends ClassLoaders.ConsumerRunnable<CurrentTraceContext.Builder> {
@Override public void accept(CurrentTraceContext.Builder builder) {
CurrentTraceContext current = builder.build();
try (Scope ws = current.newScope(TraceContext.newBuilder().traceId(1L).spanId(2L).build())) {
try (Scope scope = current.newScope(TraceContext.newBuilder().traceId(1L).spanId(2L).build())) {
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
*/
package brave.test.propagation;

import brave.internal.codec.HexCodec;
import brave.internal.Nullable;
import brave.internal.codec.HexCodec;
import brave.propagation.Propagation;
import brave.propagation.Propagation.Getter;
import brave.propagation.Propagation.Setter;
Expand Down
27 changes: 0 additions & 27 deletions brave-tests/src/main/java/brave/test/util/AssertableCallback.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.BiConsumer;
import org.assertj.core.api.AbstractThrowableAssert;
import org.assertj.core.api.ObjectAssert;

import static org.assertj.core.api.Assertions.assertThat;

Expand Down Expand Up @@ -104,31 +102,6 @@ public void onError(Throwable throwable) {
throw new AssertionError("unexpected state");
}

// TODO: not actually used as we don't need to verify http status code or otherwise yet
public ObjectAssert<V> assertThatSuccess() {
return assertThat(join());
}

// TODO: not actually used as we have no async error tests, yet
public AbstractThrowableAssert<?, ? extends Throwable> assertThatError() {
awaitUninterruptably();

if (onErrorCount.get() > 0) {
assertThat(onErrorCount)
.withFailMessage("onError signaled multiple times")
.hasValueLessThan(2);

assertThat(onSuccessCount)
.withFailMessage("Both onSuccess and onError were signaled")
.hasValue(0);

return assertThat(result == NULL_SENTINEL ? null : (Throwable) result);
} else if (onSuccessCount.get() > 0) {
throw new AssertionError("expected onError, but received onSuccess(" + result + ")");
}
throw new AssertionError(); // unexpected as we only have two callbacks to handle!
}

void awaitUninterruptably() {
try {
await(3, TimeUnit.SECONDS);
Expand Down

This file was deleted.

6 changes: 3 additions & 3 deletions brave/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ When you need more features, or finer control, use the `Span` type:
// Start a new trace or a span within an existing trace representing an operation
Span span = tracer.nextSpan().name("encode").start();
// Put the span in "scope" so that downstream code such as loggers can see trace IDs
try (SpanInScope ws = tracer.withSpanInScope(span)) {
try (SpanInScope scope = tracer.withSpanInScope(span)) {
return encoder.encode();
} catch (RuntimeException | Error e) {
span.error(e); // Unless you handle exceptions, you might not know the operation failed!
Expand Down Expand Up @@ -192,7 +192,7 @@ tracing.propagation().injector(ClientRequestWrapper::addHeader)
span.kind(request.spanKind());
span.name("Report");
span.start();
try (Scope ws = currentTraceContext.newScope(span.context())) { // 2.
try (Scope scope = currentTraceContext.newScope(span.context())) { // 2.
return invoke(request); // 3.
} catch (Throwable e) {
span.error(error); // 4.
Expand Down Expand Up @@ -721,7 +721,7 @@ external code might be invoked (such as proceeding an interceptor or
otherwise), place the span in scope like this.

```java
try (SpanInScope ws = tracer.withSpanInScope(span)) {
try (SpanInScope scope = tracer.withSpanInScope(span)) {
return inboundRequest.invoke();
} catch (RuntimeException | Error e) {
span.error(e);
Expand Down
21 changes: 1 addition & 20 deletions brave/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<parent>
<groupId>io.zipkin.brave</groupId>
<artifactId>brave-parent</artifactId>
<version>5.18.2-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
</parent>

<artifactId>brave</artifactId>
Expand All @@ -37,19 +37,6 @@
</properties>

<dependencies>
<!-- Intentionally pinned so that we can move off Tracing.Builder.spanReporter
Once zipkin-reporter-brave is out a while, we can un-pin it. -->
<dependency>
<groupId>io.zipkin.reporter2</groupId>
<artifactId>zipkin-reporter-brave</artifactId>
<version>${zipkin-reporter.version}</version>
</dependency>
<dependency>
<groupId>io.zipkin.zipkin2</groupId>
<artifactId>zipkin</artifactId>
<version>${zipkin.version}</version>
</dependency>

<!-- To show off SpanHandler -->
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down Expand Up @@ -111,12 +98,6 @@
<version>${spring5.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.zipkin.reporter2</groupId>
<artifactId>zipkin-sender-okhttp3</artifactId>
<version>${zipkin-reporter.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down
Loading

0 comments on commit cf8dbf9

Please sign in to comment.