Skip to content

Commit

Permalink
Removes all deprecated types and modules for Brave v6
Browse files Browse the repository at this point in the history
Signed-off-by: Adrian Cole <[email protected]>
  • Loading branch information
Adrian Cole committed Jan 7, 2024
1 parent 3004007 commit b8dd8af
Show file tree
Hide file tree
Showing 355 changed files with 747 additions and 19,262 deletions.
4 changes: 2 additions & 2 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ project has a bom.
$ mvn=$PWD/mvnw
$ for p in ./brave-bom .; do
(cd $p
$mvn versions:set -DnewVersion=5.17.2-SNAPSHOT -DgenerateBackupPoms=false
$mvn versions:set -DnewVersion=6.0.1-SNAPSHOT -DgenerateBackupPoms=false
$mvn -o clean install -DskipTests
$mvn com.mycila:license-maven-plugin:format
$mvn versions:set -DnewVersion=5.17.1-SNAPSHOT -DgenerateBackupPoms=false)
$mvn versions:set -DnewVersion=5.18.0-SNAPSHOT -DgenerateBackupPoms=false)
done
$ git commit -asm"Adjusts copyright headers for this year"
```
Expand Down
26 changes: 0 additions & 26 deletions brave-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
<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>

Expand Down Expand Up @@ -92,11 +91,6 @@
<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 +121,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 +131,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 +236,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 +251,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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2013-2023 The OpenZipkin Authors
* Copyright 2013-2024 The OpenZipkin Authors
*
* 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
Expand Down 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
@@ -1,5 +1,5 @@
/*
* Copyright 2013-2023 The OpenZipkin Authors
* Copyright 2013-2024 The OpenZipkin Authors
*
* 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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2013-2023 The OpenZipkin Authors
* Copyright 2013-2024 The OpenZipkin Authors
*
* 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
Expand All @@ -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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2013-2020 The OpenZipkin Authors
* Copyright 2013-2024 The OpenZipkin Authors
*
* 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
Expand All @@ -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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2013-2023 The OpenZipkin Authors
* Copyright 2013-2024 The OpenZipkin Authors
*
* 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
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion brave/RATIONALE.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ static Map<String, Key<String>> nameToKey(Propagation<String> propagation) {
}
```

In summary, even though we have a generic parameter, only `Propagation<String>`
In summary, even though we have a generic parameter, only `Propagation`
will be used in practice. We keep the generic parameter to avoid an API breaks
on a frequently used type, even if seeing it is a distraction and having it at
all was a mistake in hindsight.
Expand Down
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
13 changes: 0 additions & 13 deletions brave/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading

0 comments on commit b8dd8af

Please sign in to comment.