Skip to content

Commit

Permalink
Upgrade opentelementry dependencies. (#186)
Browse files Browse the repository at this point in the history
* Upgrade opentelementry dependencies.
Fix grammar.
Fixed wrong imports.
Code cosmetics.

* Update gradle/libs.versions.toml

* Update tracing-bom/build.gradle

* Update tracing-bom/build.gradle

* Update tracing-bom/build.gradle

Co-authored-by: Nemanja Mikic <n0t_l3ss@outlook.com>
  • Loading branch information
altro3 and n0tl3ss authored Oct 13, 2022
1 parent 3b92936 commit 598e161
Show file tree
Hide file tree
Showing 66 changed files with 232 additions and 252 deletions.
21 changes: 11 additions & 10 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
# Auto detect text files and perform LF normalization
* text=auto
* text=lf

*.java text
*.html text
*.kt text
*.kts text
*.md text diff=markdown
*.java text eol=lf
*.groovy text eol=lf
*.html text eol=lf
*.kt text eol=lf
*.kts text eol=lf
*.md text diff=markdown eol=lf
*.py text diff=python executable
*.pl text diff=perl executable
*.pm text diff=perl
*.css text diff=css
*.js text
*.sql text
*.q text
*.css text diff=css eol=lf
*.js text eol=lf
*.sql text eol=lf
*.q text eol=lf

*.sh text eol=lf
gradlew text eol=lf
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@ In this case, to fix the issues, we need to:

- Add one empty line before `package` in line 16
- Add the Javadoc for the constructor in line 27
- Add an space after `if` in line 34
- Add a space after `if` in line 34

The plugin also adds a new tab in the bottom of the IDE to run Checkstyle and show errors and warnings. We recommend that you run the report and fix all issues before submitting a pull request.
6 changes: 3 additions & 3 deletions MAINTAINING.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ All Micronaut repos have 2 dependency upgrade checking mechanism:
arrives for both, it will send 2 PRs, where they should both be upgraded at the same time.

2. To overcome those disadvantages, we have our own dependency upgrade solution based on the
[Gradle Use Latest Versions Plugin](https://github.com/patrikerdes/gradle-use-latest-versions-plugin). It runs daily
[Gradle Use The Latest Versions Plugin](https://github.com/patrikerdes/gradle-use-latest-versions-plugin). It runs daily
during weekdays.

The consequence of having both approaches in place is that we get multiple dependency upgrade PRs: one created by
Expand All @@ -109,7 +109,7 @@ unnecessary upgrade burden on our users. Read the
[Module Upgrade Strategy](https://github.com/micronaut-projects/micronaut-core/wiki/Module-Upgrade-Strategy) for more
information.

Note that if a new version arrives and we are not ready yet to do the upgrade, you need to
Note that if a new version arrives, and we are not ready yet to do the upgrade, you need to
[pin the old version](https://github.com/micronaut-projects/micronaut-build/#configuration-options), because otherwise,
Renovate and our workflow will keep sending PRs. You should also create an issue to upgrade so that it's not forgotten.

Expand All @@ -119,7 +119,7 @@ We have a [template repo](https://github.com/micronaut-projects/micronaut-projec
source of truth for certain files. It is used as a template to create new repos, and changes to certain files in the
template repo will get propagated automatically. The files propagated are:

* Workflow files (`.github/workflows/*`). They are copied using rsync"
* Workflow files (`.github/workflows/*`). They are copied using rsync
* `central-sync.yml`.
* `dependency-update.yml`.
* `graalvm.yml`.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ See the [Snapshot Documentation](https://micronaut-projects.github.io/micronaut-

## Snapshots and Releases

Snapshots are automatically published to [Sonatype Snapshots](https://s01.oss.sonatype.org/content/repositories/snapshots/io/micronaut/) using [Github Actions](https://github.com/micronaut-projects/micronaut-tracing/actions).
Snapshots are automatically published to [Sonatype Snapshots](https://s01.oss.sonatype.org/content/repositories/snapshots/io/micronaut/) using [GitHub Actions](https://github.com/micronaut-projects/micronaut-tracing/actions).

See the documentation in the [Micronaut Docs](https://docs.micronaut.io/latest/guide/index.html#usingsnapshots) for how to configure your build to use snapshots.

Releases are published to Maven Central via [Github Actions](https://github.com/micronaut-projects/micronaut-tracing/actions).
Releases are published to Maven Central via [GitHub Actions](https://github.com/micronaut-projects/micronaut-tracing/actions).

Releases are completely automated. To perform a release use the following steps:

Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ We release patches for security vulnerabilities. Which versions are eligible
receiving such patches depend on the CVSS v3.0 Rating:

| CVSS v3.0 | Supported Versions |
| --------- | ----------------------------------------- |
|-----------|-------------------------------------------|
| 9.0-10.0 | Releases within the previous three months |
| 4.0-8.9 | Most recent release |

Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
projectVersion=4.4.1-SNAPSHOT
projectGroup=io.micronaut.tracing
micronautDocsVersion=2.0.0
micronautVersion=3.6.2
micronautTestVersion=3.5.0
groovyVersion=3.0.12
spockVersion=2.1-groovy-3.0
micronautVersion=3.7.1
micronautTestVersion=3.7.0
groovyVersion=3.0.13
spockVersion=2.3-groovy-3.0

title=Micronaut Tracing
projectDesc=Adds Distributed Tracing Support
Expand Down
23 changes: 12 additions & 11 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
[versions]
managed-brave-instrumentation = '5.14.0'
managed-brave-instrumentation = '5.14.1'
managed-brave-opentracing = '1.0.0'
managed-jaeger = '1.8.1'
kotlin = '1.7.10'
kotlin = '1.7.20'
kotlin-coroutines = '1.6.4'
grpc = '1.49.0'
protobuf = '3.21.6'
grpc = '1.49.2'
protobuf = '3.21.7'
micronaut-docs = '2.0.0'
managed-opentelemetry = '1.18.0'
managed-opentelemetry-alpha = '1.15.0-alpha'
managed-opentelemetry-instrumentation-alpha = '1.15.0-alpha'
managed-opentelemetry = '1.19.0'
managed-opentelemetry-alpha = '1.19.0-alpha'
managed-opentelemetry-instrumentation-alpha = '1.19.0-alpha'
managed-opentracing = '0.33.0'
managed-opentracing-grpc = '0.2.3'
managed-protobuf = '0.8.19'
managed-protobuf = '0.9.1'
managed-zipkin-reporter = '2.16.3'
managed-opentelemetry-contrib-aws-xray = '1.17.0'
managed-opentelemetry-gcp-trace = '0.22.0-alpha'
managed-opentelemetry-contrib-aws-xray = '1.18.0'
managed-opentelemetry-contrib-aws-resources = '1.18.0'
managed-opentelemetry-gcp-trace = '0.23.0-alpha'

[libraries]
managed-opentelemetry-contrib-aws-xray = { module = 'io.opentelemetry.contrib:opentelemetry-aws-xray', version.ref = 'managed-opentelemetry-contrib-aws-xray'}
Expand All @@ -42,11 +43,11 @@ opentelemetry-api = { module = 'io.opentelemetry:opentelemetry-api' }
opentelemetry-sdk = { module = 'io.opentelemetry:opentelemetry-sdk' }
opentelemetry-sdk-testing = { module = 'io.opentelemetry:opentelemetry-sdk-testing' }
opentelemetry-sdk-extension-aws = { module = 'io.opentelemetry:opentelemetry-sdk-extension-aws' }
opentelemetry-extension-annotations = { module = 'io.opentelemetry:opentelemetry-extension-annotations' }
opentelemetry-autoconfigure = { module = 'io.opentelemetry:opentelemetry-sdk-extension-autoconfigure' }
opentelemetry-instrumentation-api = { module = 'io.opentelemetry.instrumentation:opentelemetry-instrumentation-api' }
opentelemetry-instrumentation-grpc = { module = 'io.opentelemetry.instrumentation:opentelemetry-grpc-1.6'}
opentelemetry-instrumentation-api-semconv = { module = 'io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv' }
opentelemetry-instrumentation-annotations = { module = 'io.opentelemetry.instrumentation: opentelemetry-instrumentation-annotations' }
opentelemetry-aws-sdk = { module = 'io.opentelemetry.instrumentation:opentelemetry-aws-sdk-2.2' }

awssdk-core = { module = 'software.amazon.awssdk:sdk-core' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import org.reactivestreams.Publisher
import reactor.core.publisher.Flux
import reactor.core.publisher.Mono
import reactor.util.context.Context
import reactor.util.function.Tuple2
import reactor.util.function.Tuples
import java.util.UUID

Expand All @@ -44,18 +43,18 @@ class ReactorContextPropagationSpec {
)
val client = embeddedServer.applicationContext.getBean(HttpClient::class.java)

val result: MutableList<Tuple2<String, String>> = Flux.range(1, 100)
val result = Flux.range(1, 100)
.flatMap {
val tracingId = UUID.randomUUID().toString()
val get = HttpRequest.POST<Any>("http://localhost:${embeddedServer.port}/trigger", NameRequestBody("sss-" + tracingId))
val get = HttpRequest.POST<Any>("http://localhost:${embeddedServer.port}/trigger", NameRequestBody("sss-$tracingId"))
.header("X-TrackingId", tracingId)
Mono.from(client.retrieve(get, String::class.java))
.map { Tuples.of(it as String, tracingId) }
}
.collectList()
.block()

for (t in result) {
for (t in result!!) {
assert(t.t1 == t.t2)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
*/
@Retention(RUNTIME)
@Inherited
@Target(value = {METHOD, ANNOTATION_TYPE})
@Target({METHOD, ANNOTATION_TYPE})
@InterceptorBinding
public @interface ContinueSpan {
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*/
@Retention(RUNTIME)
@Inherited
@Target(value = {METHOD, ANNOTATION_TYPE})
@Target({METHOD, ANNOTATION_TYPE})
@Type(InterceptorBinding.class)
@InterceptorBinding
public @interface NewSpan {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
*/
@Retention(RUNTIME)
@Inherited
@Target(value = {PARAMETER, ANNOTATION_TYPE})
@Target({PARAMETER, ANNOTATION_TYPE})
public @interface SpanTag {

/**
Expand Down
22 changes: 14 additions & 8 deletions tracing-bom/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@ plugins {
}

micronautBom {
extraExcludedProjects.add 'kotlin-tests'
suppressions {
bomAuthorizedGroupIds.put(
extraExcludedProjects.add 'kotlin-tests'
suppressions {
bomAuthorizedGroupIds.put(
"io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom-alpha",
["io.opentelemetry.javaagent", "io.opentelemetry", "io.opentelemetry.instrumentation", "io.opentelemetry.javaagent.instrumentation"] as Set
)
dependencies.add("io.opentelemetry:opentelemetry-bom:1.15.0")
dependencies.add("io.opentelemetry:opentelemetry-bom-alpha:1.15.0-alpha")
}
[
"io.opentelemetry",
"io.opentelemetry.instrumentation",
"io.opentelemetry.javaagent",
"io.opentelemetry.javaagent.instrumentation"
] as Set
)
dependencies.add("io.opentelemetry:opentelemetry-bom:1.19.0")
dependencies.add("io.opentelemetry:opentelemetry-bom-alpha:1.19.0-alpha")
dependencies.add("io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom:1.19.0")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
public class DefaultTracer {

/**
* Creates a default {@link io.opentracing.noop.NoopTracer} if no other <code>Tracer</code> is present.
* Creates a default {@link io.opentracing.noop.NoopTracer} if no other {@code Tracer} is present.
*
* @return no-op <code>Tracer</code>
* @return no-op {@code Tracer}
*/
@Singleton
@Primary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import java.util.Map;

/**
* A <code>TextMap</code> implementations for the headers.
* A {@code TextMap} implementations for the headers.
*
* @author graemerocher
* @since 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import io.micronaut.core.annotation.NonNull;

/**
* Constants used to store <code>Span</code>s in instrumented request attributes.
* Constants used to store {@code Span}s in instrumented request attributes.
*
* @author graemerocher
* @since 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
import io.micronaut.context.annotation.Context;
import io.micronaut.context.annotation.Requires;
import io.micronaut.core.annotation.Internal;
import io.micronaut.core.annotation.NonNull;
import io.micronaut.http.bind.binders.HttpCoroutineContextFactory;
import io.micronaut.tracing.instrument.util.TracingInvocationInstrumenterFactory;
import jakarta.inject.Singleton;
import kotlin.coroutines.CoroutineContext;
import kotlinx.coroutines.ThreadContextElement;
import org.jetbrains.annotations.NotNull;

import java.util.List;
import java.util.stream.Collectors;
Expand All @@ -46,7 +46,7 @@ final class HttpCoroutineTracingDispatcherFactory implements HttpCoroutineContex
this.instrumenters = instrumenters;
}

@NotNull
@NonNull
@Override
public CoroutineTracingDispatcher create() {
return new CoroutineTracingDispatcher(instrumenters.stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.reactivestreams.Subscription;

/**
* A <code>Publisher</code> that just propagates tracing state without creating a new span.
* A {@code Publisher} that just propagates tracing state without creating a new span.
*
* @param <T> the publisher generic type
* @author graemerocher
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@ private final class TracingCoreSubscriber extends TracingSubscriber implements C

private final Context context;

public TracingCoreSubscriber(ScopeManager scopeManager,
Span span,
Subscriber<? super T> actual,
boolean finishOnClose,
Context context) {
private TracingCoreSubscriber(ScopeManager scopeManager,
Span span,
Subscriber<? super T> actual,
boolean finishOnClose,
Context context) {
super(scopeManager, span, actual, finishOnClose);
this.context = context;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public TracingPublisher(Publisher<T> publisher,
this.publisher = publisher;
this.tracer = tracer;
this.spanBuilder = spanBuilder;
this.parentSpan = tracer.activeSpan();
parentSpan = tracer.activeSpan();
this.isSingle = isSingle;
this.tracingObserver = tracingObserver;
if (parentSpan != null && spanBuilder != null) {
Expand Down Expand Up @@ -296,11 +296,11 @@ public TracingSubscriber(ScopeManager scopeManager, Span span, Subscriber<? supe
public void onSubscribe(Subscription s) {
if (scopeManager.activeSpan() != span) {
try (Scope ignored = scopeManager.activate(span)) {
TracingPublisher.this.doOnSubscribe(span);
doOnSubscribe(span);
actual.onSubscribe(s);
}
} else {
TracingPublisher.this.doOnSubscribe(span);
doOnSubscribe(span);
actual.onSubscribe(s);
}
}
Expand All @@ -323,11 +323,11 @@ public void onNext(T object) {
}

}
TracingPublisher.this.doOnNext(object, span);
doOnNext(object, span);
actual.onNext(object);
if (isSingle) {
finished = true;
TracingPublisher.this.doOnFinish(span);
doOnFinish(span);
}
} finally {
if (finishAfterNext) {
Expand All @@ -353,7 +353,7 @@ public void onError(Throwable t) {
public void onComplete() {
try (Scope ignored = scopeManager.activeSpan() != span ? scopeManager.activate(span) : NoopScope.INSTANCE) {
actual.onComplete();
TracingPublisher.this.doOnFinish(span);
doOnFinish(span);
} finally {
if (!finished && finishOnClose) {
span.finish();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import static io.opentracing.log.Fields.MESSAGE;

/**
* Implements tracing logic for <code>ContinueSpan</code> and <code>NewSpan</code>
* Implements tracing logic for {@code ContinueSpan} and {@code NewSpan}
* using the Open Tracing API.
*
* @author graemerocher
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import org.reactivestreams.Publisher;

/**
* Implements tracing logic for <code>ContinueSpan</code> and <code>NewSpan</code>
* Implements tracing logic for {@code ContinueSpan} and {@code NewSpan}
* using the Open Tracing API.
*
* @author graemerocher
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import io.micronaut.core.annotation.NonNull;
import io.micronaut.core.annotation.Nullable;
import io.micronaut.core.util.StringUtils;
import io.micronaut.tracing.annotation.ContinueSpan;
import io.micronaut.tracing.annotation.NewSpan;
import io.micronaut.tracing.instrument.util.TracingObserver;
import io.micronaut.tracing.instrument.util.TracingPublisher;
Expand All @@ -39,7 +38,7 @@
import java.util.concurrent.CompletionStage;

/**
* Implements tracing logic for <code>ContinueSpan</code> and <code>NewSpan</code>
* Implements tracing logic for {@code ContinueSpan} and {@code NewSpan}
* using the Open Tracing API.
*
* @author graemerocher
Expand Down
Loading

0 comments on commit 598e161

Please sign in to comment.