Removed OTel (#1802)
This commit is contained in:
committed by
GitHub
parent
89433dc4d7
commit
4c3d12e639
@@ -42,23 +42,6 @@ Example of Sleuth with Brave tracer:
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-sleuth</artifactId>
|
||||
</dependency>
|
||||
<!-- Sleuth with OpenTelemetry tracer implementation -->
|
||||
<!--
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-sleuth</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-sleuth-brave</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-sleuth-otel</artifactId>
|
||||
</dependency>
|
||||
-->
|
||||
</dependencies>
|
||||
----
|
||||
|
||||
|
||||
@@ -20,8 +20,6 @@
|
||||
:autoconfig_path: {project-root}/spring-cloud-sleuth-autoconfigure
|
||||
:api_path: {project-root}/spring-cloud-sleuth-api
|
||||
:brave_path: {project-root}/spring-cloud-sleuth-brave
|
||||
:otel_path: {project-root}/spring-cloud-sleuth-otel
|
||||
:tests_path: {core_path}/tests
|
||||
:common_tests_path: {tests_path}/common
|
||||
:brave_tests_path: {tests_path}/brave
|
||||
:otel_tests_path: {tests_path}/otel
|
||||
|
||||
@@ -32,19 +32,6 @@
|
||||
|spring.sleuth.messaging.rabbit.enabled | `true` | Enable tracing of RabbitMQ.
|
||||
|spring.sleuth.mongodb.enabled | `true` | Enable tracing for MongoDb.
|
||||
|spring.sleuth.opentracing.enabled | `true` | Enables OpenTracing support.
|
||||
|spring.sleuth.otel.config.instrumentation-name | `org.springframework.cloud.spring-cloud-sleuth` | Instrumentation name to be used to find a Tracer.
|
||||
|spring.sleuth.otel.config.instrumentation-version | | Instrumentation version to be used to find a Tracer.
|
||||
|spring.sleuth.otel.config.max-attr-length | `0` | Returns the global default max length of string attribute value in characters.
|
||||
|spring.sleuth.otel.config.max-attrs | `0` | Returns the global default max number of attributes per {@link Span}.
|
||||
|spring.sleuth.otel.config.max-event-attrs | `0` | Returns the global default max number of attributes per event.
|
||||
|spring.sleuth.otel.config.max-events | `0` | Returns the global default max number of events per {@link Span}.
|
||||
|spring.sleuth.otel.config.max-link-attrs | `0` | Returns the global default max number of attributes per link.
|
||||
|spring.sleuth.otel.config.max-links | `0` | Returns the global default max number of link entries per {@link Span}.
|
||||
|spring.sleuth.otel.exporter.sleuth-span-filter.enabled | `true` | Enables Sleuth span filter.
|
||||
|spring.sleuth.otel.log.exporter.enabled | `false` | Enable log exporter for OTel.
|
||||
|spring.sleuth.otel.log.slf4j.enabled | `false` | Enable slf4j support for OTel.
|
||||
|spring.sleuth.otel.propagation.composite-text-map-propagator.enabled | `true` | Enable a composite text map propagator that can combine multiple propagation types into a single text map propagator.
|
||||
|spring.sleuth.otel.propagation.sleuth-baggage.enabled | `true` | Enable propagating baggage in a Sleuth compatible way (baggage key & value pair means e.g. a key & value HTTP pair).
|
||||
|spring.sleuth.propagation.type | | Tracing context propagation types.
|
||||
|spring.sleuth.quartz.enabled | `true` | Enable tracing for Quartz.
|
||||
|spring.sleuth.reactor.decorate-on-each | `true` | When true decorates on each operator, will be less performing, but logging will always contain the tracing entries in each operator. When false decorates on last operator, will be more performing, but logging might not always contain the tracing entries. @deprecated use explicit value via {@link SleuthReactorProperties#instrumentationType}
|
||||
|
||||
@@ -65,8 +65,7 @@ Need more details about {project-full-name}'s core features?
|
||||
<<project-features.adoc#features-baggage, Baggage>>
|
||||
|
||||
* *Tracer Features:*
|
||||
<<project-features.adoc#features-brave, OpenZipkin Brave>> |
|
||||
<<project-features.adoc#features-otel, OpenTelemetry>>
|
||||
<<project-features.adoc#features-brave, OpenZipkin Brave>>
|
||||
|
||||
* *Reporting Features:*
|
||||
<<project-features.adoc#features-zipkin, Zipkin>> |
|
||||
|
||||
@@ -15,11 +15,10 @@ Spring Cloud Sleuth provides API for distributed tracing solution for https://cl
|
||||
It integrates out of the box with two tracer implementations:
|
||||
|
||||
* https://github.com/openzipkin/brave[OpenZipkin Brave]
|
||||
* https://opentelemetry.io[OpenTelemetry SDK]
|
||||
|
||||
Spring Cloud Sleuth is able to trace your requests and messages so that you can correlate that communication to corresponding log entries.
|
||||
You can also export the tracing information to an external system to visualize latency.
|
||||
Spring Cloud Sleuth supports https://zipkin.io[OpenZipkin] compatible systems directly and various other ones via the OpenTelemetry integration.
|
||||
Spring Cloud Sleuth supports https://zipkin.io[OpenZipkin] compatible systems directly.
|
||||
|
||||
[[getting-started-terminology]]
|
||||
=== Terminology
|
||||
@@ -193,36 +192,6 @@ To add the necessary dependencies, edit your `pom.xml` and add the `spring-boot-
|
||||
</dependencies>
|
||||
----
|
||||
|
||||
To use Sleuth with OpenTelemetry do the following.
|
||||
|
||||
[source,xml,indent=0,subs="verbatim,quotes,attributes"]
|
||||
----
|
||||
<dependencies>
|
||||
<!-- Boot's Web support -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<!-- Sleuth with Brave tracer implementation -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-sleuth</artifactId>
|
||||
<exclusions>
|
||||
<!-- Exclude Brave -->
|
||||
<exclusion>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-sleuth-brave</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<!-- Add OpenTelemetry tracer -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-sleuth-otel</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
----
|
||||
|
||||
[[getting-started-first-application-code]]
|
||||
=== Writing the Code
|
||||
|
||||
|
||||
@@ -55,60 +55,6 @@ dependencies {
|
||||
----
|
||||
====
|
||||
|
||||
[[how-to-set-up-sleuth-with-otel]]
|
||||
== How to Set Up Sleuth with OpenTelemetry?
|
||||
|
||||
Add the Sleuth starter, exlcude Brave and add OpenTelemetry dependency to the classpath.
|
||||
|
||||
====
|
||||
[source,xml,indent=0,subs="verbatim,attributes",role="primary"]
|
||||
.Maven
|
||||
----
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-dependencies</artifactId>
|
||||
<version>${release.train-version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-sleuth</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-sleuth-brave</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-sleuth-otel</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
[source,groovy,indent=0,subs="verbatim,attributes",role="secondary"]
|
||||
.Gradle
|
||||
----
|
||||
dependencyManagement {
|
||||
imports {
|
||||
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${releaseTrainVersion}"
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("org.springframework.cloud:spring-cloud-starter-sleuth") {
|
||||
exclude group: 'org.springframework.cloud', module: 'spring-cloud-sleuth-brave'
|
||||
}
|
||||
}
|
||||
----
|
||||
====
|
||||
|
||||
[[how-to-set-up-sleuth-with-brave-zipkin-http]]
|
||||
== How to Set Up Sleuth with Brave & Zipkin via HTTP?
|
||||
|
||||
@@ -156,65 +102,6 @@ dependencies {
|
||||
----
|
||||
====
|
||||
|
||||
[[how-to-set-up-sleuth-with-otel-zipkin-http]]
|
||||
== How to Set Up Sleuth with OpenTelemetry & Zipkin via HTTP?
|
||||
|
||||
Add the Sleuth starter, exclude Brave, add OTel and Zipkin to the classpath.
|
||||
|
||||
====
|
||||
[source,xml,indent=0,subs="verbatim,attributes",role="primary"]
|
||||
.Maven
|
||||
----
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-dependencies</artifactId>
|
||||
<version>${release.train-version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-sleuth</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-sleuth-brave</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-sleuth-otel</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-sleuth-zipkin</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
[source,groovy,indent=0,subs="verbatim,attributes",role="secondary"]
|
||||
.Gradle
|
||||
----
|
||||
dependencyManagement {
|
||||
imports {
|
||||
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${releaseTrainVersion}"
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("org.springframework.cloud:spring-cloud-starter-sleuth") {
|
||||
exclude group: 'org.springframework.cloud', module: 'spring-cloud-sleuth-brave'
|
||||
}
|
||||
implementation "org.springframework.cloud:spring-cloud-sleuth-zipkin"
|
||||
}
|
||||
----
|
||||
====
|
||||
|
||||
[[how-to-set-up-sleuth-with-brave-zipkin-messaging]]
|
||||
== How to Set Up Sleuth with Brave & Zipkin via Messaging?
|
||||
|
||||
@@ -382,197 +269,6 @@ Also, you need to set the property `spring.zipkin.sender.type` property accordin
|
||||
spring.zipkin.sender.type: activemq
|
||||
----
|
||||
|
||||
[[how-to-set-up-sleuth-with-otel-zipkin-messaging]]
|
||||
== How to Set Up Sleuth with OpenTelemetry & Zipkin via Messaging?
|
||||
|
||||
If you want to use RabbitMQ, Kafka or ActiveMQ instead of HTTP, add the `spring-rabbit`, `spring-kafka` or `org.apache.activemq:activemq-client` dependency.
|
||||
The default destination name is `Zipkin`.
|
||||
|
||||
If using Kafka, you must add the Kafka dependency.
|
||||
|
||||
====
|
||||
[source,xml,indent=0,subs="verbatim,attributes",role="primary"]
|
||||
.Maven
|
||||
----
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-dependencies</artifactId>
|
||||
<version>${release.train-version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-sleuth</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-sleuth-brave</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-sleuth-otel</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-sleuth-zipkin</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.kafka</groupId>
|
||||
<artifactId>spring-kafka</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
[source,groovy,indent=0,subs="verbatim,attributes",role="secondary"]
|
||||
.Gradle
|
||||
----
|
||||
dependencyManagement {
|
||||
imports {
|
||||
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${releaseTrainVersion}"
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("org.springframework.cloud:spring-cloud-starter-sleuth") {
|
||||
exclude group: 'org.springframework.cloud', module: 'spring-cloud-sleuth-brave'
|
||||
}
|
||||
implementation "org.springframework.cloud:spring-cloud-sleuth-zipkin"
|
||||
implementation "org.springframework.kafka:spring-kafka"
|
||||
}
|
||||
----
|
||||
====
|
||||
|
||||
Also, you need to set the property `spring.zipkin.sender.type` property accordingly:
|
||||
|
||||
[source,yaml]
|
||||
----
|
||||
spring.zipkin.sender.type: kafka
|
||||
----
|
||||
|
||||
If you want Sleuth over RabbitMQ, add the `spring-cloud-sleuth-otel` (exclude `spring-cloud-sleuth-brave`), `spring-cloud-sleuth-zipkin` and `spring-rabbit` dependencies.
|
||||
|
||||
====
|
||||
[source,xml,indent=0,subs="verbatim,attributes",role="primary"]
|
||||
.Maven
|
||||
----
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-dependencies</artifactId>
|
||||
<version>${release.train-version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-sleuth</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-sleuth-zipkin</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.amqp</groupId>
|
||||
<artifactId>spring-rabbit</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
[source,groovy,indent=0,subs="verbatim,attributes",role="secondary"]
|
||||
.Gradle
|
||||
----
|
||||
dependencyManagement {
|
||||
imports {
|
||||
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${releaseTrainVersion}"
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "org.springframework.cloud:spring-cloud-starter-sleuth"
|
||||
implementation "org.springframework.cloud:spring-cloud-sleuth-zipkin"
|
||||
implementation "org.springframework.amqp:spring-rabbit"
|
||||
}
|
||||
----
|
||||
====
|
||||
|
||||
If you want Sleuth over RabbitMQ, add the `spring-cloud-sleuth-otel` (exclude `spring-cloud-sleuth-brave`), `spring-cloud-sleuth-zipkin` and `activemq-client` dependencies.
|
||||
|
||||
====
|
||||
[source,xml,indent=0,subs="verbatim,attributes",role="primary"]
|
||||
.Maven
|
||||
----
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-dependencies</artifactId>
|
||||
<version>${release.train-version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-sleuth</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-sleuth-brave</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-sleuth-otel</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-sleuth-zipkin</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.activemq</groupId>
|
||||
<artifactId>activemq-client</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
[source,groovy,indent=0,subs="verbatim,attributes",role="secondary"]
|
||||
.Gradle
|
||||
----
|
||||
dependencyManagement {
|
||||
imports {
|
||||
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${releaseTrainVersion}"
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("org.springframework.cloud:spring-cloud-starter-sleuth") {
|
||||
exclude group: 'org.springframework.cloud', module: 'spring-cloud-sleuth-brave'
|
||||
}
|
||||
implementation "org.springframework.cloud:spring-cloud-sleuth-zipkin"
|
||||
implementation "org.apache.activemq:activemq-client"
|
||||
}
|
||||
----
|
||||
====
|
||||
|
||||
Also, you need to set the property `spring.zipkin.sender.type` property accordingly:
|
||||
|
||||
[source,yaml]
|
||||
----
|
||||
spring.zipkin.sender.type: activemq
|
||||
----
|
||||
|
||||
[[how-to-see-spans-in-an-external-system]]
|
||||
== How to See Spans in an External System?
|
||||
|
||||
@@ -601,42 +297,6 @@ If the boolean value in the section `[backend,0b6aaf642574edd3,0b6aaf642574edd3,
|
||||
Up till Sleuth 3.0.0 the dependency `spring-cloud-starter-zipkin` included the `spring-cloud-starter-sleuth` dependency and the `spring-cloud-sleuth-zipkin` dependency.
|
||||
With 3.0.0 `spring-cloud-starter-zipkin` was removed, so you need to change it to `spring-cloud-sleuth-zipkin`.
|
||||
|
||||
If you're working with OpenTelemetry you need to provide the dependency with your exporter.
|
||||
For example if you want to use the OpenTelemetry Zipkin Exporter just add a dependency.
|
||||
|
||||
====
|
||||
[source,xml,indent=0,subs="verbatim,attributes",role="primary"]
|
||||
.Maven
|
||||
----
|
||||
<dependency>
|
||||
<groupId>io.opentelemetry</groupId>
|
||||
<artifactId>opentelemetry-exporter-zipkin</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
[source,groovy,indent=0,subs="verbatim,attributes",role="secondary"]
|
||||
.Gradle
|
||||
----
|
||||
dependencies {
|
||||
implementation "io.opentelemetry:opentelemetry-exporter-zipkin"
|
||||
}
|
||||
----
|
||||
====
|
||||
|
||||
Then add the `SpanExporter` bean.
|
||||
|
||||
====
|
||||
[source,java,indent=0]
|
||||
----
|
||||
@Bean SpanExporter zipkinExporter() {
|
||||
return ZipkinSpanExporter.builder()
|
||||
.setEndpoint("http://localhost/api/v2/spans")
|
||||
.setServiceName("my-service")
|
||||
.build();
|
||||
}
|
||||
----
|
||||
====
|
||||
|
||||
[[connection-misconfiguration]]
|
||||
=== Connection Misconfiguration
|
||||
|
||||
@@ -781,30 +441,21 @@ To use the provided defaults you can set the `spring.sleuth.propagation.type` pr
|
||||
The value can be a list in which case you will propagate more tracing headers.
|
||||
|
||||
For Brave we support `AWS`, `B3`, `W3C` propagation types.
|
||||
For OpenTelemetry we support `AWS`, `B3`, `JAEGER`, `W3C`, `OT_TRACER` and `W3C` propagation types.
|
||||
|
||||
If you want to provide a custom propagation mechanism set the `spring.sleuth.propagation.type` property to `CUSTOM` and implement your own bean (`Propagation.Factory` for Brave and `TextMapPropagator` for OpenTelemetry).
|
||||
If you want to provide a custom propagation mechanism set the `spring.sleuth.propagation.type` property to `CUSTOM` and implement your own bean (`Propagation.Factory` for Brave).
|
||||
Below you can find the examples:
|
||||
|
||||
====
|
||||
[source,java,indent=0,subs="verbatim,attributes",role="primary"]
|
||||
.Brave
|
||||
[source,java,indent=0,subs="verbatim,attributes"]
|
||||
----
|
||||
@Component
|
||||
include::{autoconfig_path}/src/test/java/org/springframework/cloud/sleuth/autoconfig/brave/BravePropagationTests.java[tags=custom_propagator,indent=0]
|
||||
----
|
||||
|
||||
[source,java,indent=0,subs="verbatim,attributes",role="secondary"]
|
||||
.OpenTelemetry
|
||||
----
|
||||
@Component
|
||||
include::{autoconfig_path}/src/test/java/org/springframework/cloud/sleuth/autoconfig/otel/OtelPropagationConfigurationTests.java[tags=custom_propagator,indent=0]
|
||||
----
|
||||
====
|
||||
|
||||
[[how-to-implement-own-tracer]]
|
||||
== How to Implement My Own Tracer?
|
||||
|
||||
Spring Cloud Sleuth API contains all necessary interfaces to be implemented by a tracer.
|
||||
The project comes with OpenZipkin Brave and OpenTelemetry implementations.
|
||||
You can check how both tracers are bridged to the Sleuth's API by looking at the `org.springframework.cloud.sleuth.brave.bridge` and `org.springframework.cloud.sleuth.otel.bridge` modules respectively.
|
||||
The project comes with OpenZipkin Brave implementation.
|
||||
You can check how both tracers are bridged to the Sleuth's API by looking at the `org.springframework.cloud.sleuth.brave.bridge` module.
|
||||
@@ -13,7 +13,7 @@ In this section, we describe how to customize asynchronous communication with Sp
|
||||
[[sleuth-async-annotation-integration]]
|
||||
=== `@Async` Annotated methods
|
||||
|
||||
This feature is available for both Brave and OpenTelemetry tracer implementation.
|
||||
This feature is available for all tracer implementations.
|
||||
|
||||
In Spring Cloud Sleuth, we instrument async-related components so that the tracing information is passed between threads.
|
||||
You can disable this behavior by setting the value of `spring.sleuth.async.enabled` to `false`.
|
||||
@@ -27,7 +27,7 @@ If you annotate your method with `@Async`, we automatically create a new Span wi
|
||||
[[sleuth-async-scheduled-integration]]
|
||||
=== `@Scheduled` Annotated Methods
|
||||
|
||||
This feature is available for both Brave and OpenTelemetry tracer implementation.
|
||||
This feature is available for all tracer implementations.
|
||||
|
||||
In Spring Cloud Sleuth, we instrument scheduled method execution so that the tracing information is passed between threads.
|
||||
You can disable this behavior by setting the value of `spring.sleuth.scheduled.enabled` to `false`.
|
||||
@@ -42,7 +42,7 @@ If you want to skip span creation for some `@Scheduled` annotated classes, you c
|
||||
[[sleuth-async-executor-service-integration]]
|
||||
=== Executor, ExecutorService, and ScheduledExecutorService
|
||||
|
||||
This feature is available for both Brave and OpenTelemetry tracer implementation.
|
||||
This feature is available for all tracer implementations.
|
||||
|
||||
We provide `LazyTraceExecutor`, `TraceableExecutorService`, and `TraceableScheduledExecutorService`.
|
||||
Those implementations create spans each time a new task is submitted, invoked, or scheduled.
|
||||
@@ -85,7 +85,7 @@ Features from this section can be disabled by setting the `spring.sleuth.web.cli
|
||||
[[sleuth-http-client-rest-template-integration]]
|
||||
=== Synchronous Rest Template
|
||||
|
||||
This feature is available for both Brave and OpenTelemetry tracer implementation.
|
||||
This feature is available for all tracer implementations.
|
||||
|
||||
We inject a `RestTemplate` interceptor to ensure that all the tracing information is passed to the requests.
|
||||
Each time a call is made, a new Span is created.
|
||||
@@ -98,7 +98,7 @@ If you create a `RestTemplate` instance with a `new` keyword, the instrumentatio
|
||||
[[sleuth-http-client-async-rest-template-integration]]
|
||||
=== Asynchronous Rest Template
|
||||
|
||||
This feature is available for both Brave and OpenTelemetry tracer implementation.
|
||||
This feature is available for all tracer implementations.
|
||||
|
||||
IMPORTANT: Starting with Sleuth `2.0.0`, we no longer register a bean of `AsyncRestTemplate` type.
|
||||
It is up to you to create such a bean.
|
||||
@@ -123,7 +123,7 @@ include::{common_tests_path}/src/main/java/org/springframework/cloud/sleuth/inst
|
||||
[[sleuth-http-client-webclient-integration]]
|
||||
==== `WebClient`
|
||||
|
||||
This feature is available for both Brave and OpenTelemetry tracer implementation.
|
||||
This feature is available for all tracer implementations.
|
||||
|
||||
We inject a `ExchangeFilterFunction` implementation that creates a span and, through on-success and on-error callbacks, takes care of closing client-side spans.
|
||||
|
||||
@@ -135,7 +135,7 @@ If you create a `WebClient` instance with a `new` keyword, the instrumentation d
|
||||
[[sleuth-http-client-traverson-integration]]
|
||||
==== Traverson
|
||||
|
||||
This feature is available for both Brave and OpenTelemetry tracer implementation.
|
||||
This feature is available for all tracer implementations.
|
||||
|
||||
If you use the https://docs.spring.io/spring-hateoas/docs/current/reference/html/#client.traverson[Traverson] library, you can inject a `RestTemplate` as a bean into your Traverson object.
|
||||
Since `RestTemplate` is already intercepted, you get full support for tracing in your client.
|
||||
@@ -162,7 +162,7 @@ To block these features, set `spring.sleuth.web.client.enabled` to `false`.
|
||||
[[sleuth-http-client-netty-integration]]
|
||||
==== Netty `HttpClient`
|
||||
|
||||
This feature is available for both Brave and OpenTelemetry tracer implementation.
|
||||
This feature is available for all tracer implementations.
|
||||
|
||||
We instrument the Netty's `HttpClient`.
|
||||
|
||||
@@ -174,7 +174,7 @@ If you create a `HttpClient` instance with a `new` keyword, the instrumentation
|
||||
[[sleuth-http-client-userinfo-integration]]
|
||||
==== `UserInfoRestTemplateCustomizer`
|
||||
|
||||
This feature is available for both Brave and OpenTelemetry tracer implementation.
|
||||
This feature is available for all tracer implementations.
|
||||
|
||||
We instrument the Spring Security's `UserInfoRestTemplateCustomizer`.
|
||||
|
||||
@@ -188,7 +188,7 @@ Features from this section can be disabled by setting the `spring.sleuth.web.ena
|
||||
[[sleuth-http-server-http-filter-integration]]
|
||||
=== HTTP Filter
|
||||
|
||||
This feature is available for both Brave and OpenTelemetry tracer implementation.
|
||||
This feature is available for all tracer implementations.
|
||||
|
||||
Through the `TracingFilter`, all sampled incoming requests result in creation of a Span.
|
||||
You can configure which URIs you would like to skip by setting the `spring.sleuth.web.skipPattern` property.
|
||||
@@ -208,7 +208,7 @@ To disable the filter that logs uncaught exceptions you can disable the
|
||||
[[sleuth-http-server-handler-interceptor-integration]]
|
||||
=== HandlerInterceptor
|
||||
|
||||
This feature is available for both Brave and OpenTelemetry tracer implementation.
|
||||
This feature is available for all tracer implementations.
|
||||
|
||||
Since we want the span names to be precise, we use a `TraceHandlerInterceptor` that either wraps an existing `HandlerInterceptor` or is added directly to the list of existing `HandlerInterceptors`.
|
||||
The `TraceHandlerInterceptor` adds a special request attribute to the given `HttpServletRequest`.
|
||||
@@ -219,14 +219,14 @@ In that case, please file an issue in Spring Cloud Sleuth.
|
||||
[[sleuth-http-server-async-integration]]
|
||||
=== Async Servlet support
|
||||
|
||||
This feature is available for both Brave and OpenTelemetry tracer implementation.
|
||||
This feature is available for all tracer implementations.
|
||||
|
||||
If your controller returns a `Callable` or a `WebAsyncTask`, Spring Cloud Sleuth continues the existing span instead of creating a new one.
|
||||
|
||||
[[sleuth-http-server-webflux-integration]]
|
||||
=== WebFlux support
|
||||
|
||||
This feature is available for both Brave and OpenTelemetry tracer implementation.
|
||||
This feature is available for all tracer implementations.
|
||||
|
||||
Through `TraceWebFilter`, all sampled incoming requests result in creation of a Span.
|
||||
That Span's name is `http:` + the path to which the request was sent.
|
||||
@@ -255,7 +255,7 @@ Features from this section can be disabled by setting the `spring.sleuth.messagi
|
||||
[[sleuth-messaging-spring-integration-integration]]
|
||||
=== Spring Integration
|
||||
|
||||
This feature is available for both Brave and OpenTelemetry tracer implementation.
|
||||
This feature is available for all tracer implementations.
|
||||
|
||||
Spring Cloud Sleuth integrates with https://projects.spring.io/spring-integration/[Spring Integration].
|
||||
It creates spans for publish and subscribe events.
|
||||
@@ -289,7 +289,7 @@ include::{common_tests_path}/src/main/java/org/springframework/cloud/sleuth/inst
|
||||
[[sleuth-messaging-spring-cloud-function-integration]]
|
||||
=== Spring Cloud Function and Spring Cloud Stream
|
||||
|
||||
This feature is available for both Brave and OpenTelemetry tracer implementation.
|
||||
This feature is available for all tracer implementations.
|
||||
|
||||
Spring Cloud Sleuth can instrument Spring Cloud Function.
|
||||
The way to achieve it is to provide a `Function` or `Consumer` or `Supplier` that takes in a `Message` as a parameter e.g. `Function<Message<String>, Message<Integer>>`.
|
||||
@@ -352,7 +352,7 @@ IMPORTANT: We don't support baggage propagation for JMS
|
||||
[[sleuth-openfeign-integration]]
|
||||
== OpenFeign
|
||||
|
||||
This feature is available for both Brave and OpenTelemetry tracer implementation.
|
||||
This feature is available for all tracer implementations.
|
||||
|
||||
By default, Spring Cloud Sleuth provides integration with Feign through `TraceFeignClientAutoConfiguration`.
|
||||
You can disable it entirely by setting `spring.sleuth.feign.enabled` to `false`.
|
||||
@@ -366,7 +366,7 @@ However, all the default instrumentation is still there.
|
||||
[[sleuth-opentracing-integration]]
|
||||
== OpenTracing
|
||||
|
||||
This feature is available for both Brave and OpenTelemetry tracer implementation.
|
||||
This feature is available for all tracer implementations.
|
||||
|
||||
Spring Cloud Sleuth is compatible with https://opentracing.io/[OpenTracing].
|
||||
If you have OpenTracing on the classpath, we automatically register the OpenTracing `Tracer` bean.
|
||||
@@ -375,7 +375,7 @@ If you wish to disable this, set `spring.sleuth.opentracing.enabled` to `false`
|
||||
[[sleuth-quartz-integration]]
|
||||
== Quartz
|
||||
|
||||
This feature is available for both Brave and OpenTelemetry tracer implementation.
|
||||
This feature is available for all tracer implementations.
|
||||
|
||||
We instrument quartz jobs by adding Job/Trigger listeners to the Quartz Scheduler.
|
||||
|
||||
@@ -384,7 +384,7 @@ To turn off this feature, set the `spring.sleuth.quartz.enabled` property to `fa
|
||||
[[sleuth-reactor-integration]]
|
||||
== Reactor
|
||||
|
||||
This feature is available for both Brave and OpenTelemetry tracer implementation.
|
||||
This feature is available for all tracer implementations.
|
||||
|
||||
We have three modes of instrumenting reactor based applications that can be set via `spring.sleuth.reactor.instrumentation-type` property:
|
||||
|
||||
@@ -417,7 +417,7 @@ To disable Redis support, set the `spring.sleuth.redis.enabled` property to `fal
|
||||
[[sleuth-runnablecallable-integration]]
|
||||
== Runnable and Callable
|
||||
|
||||
This feature is available for both Brave and OpenTelemetry tracer implementation.
|
||||
This feature is available for all tracer implementations.
|
||||
|
||||
If you wrap your logic in `Runnable` or `Callable`, you can wrap those classes in their Sleuth representative, as shown in the following example for `Runnable`:
|
||||
|
||||
@@ -545,7 +545,7 @@ https://github.com/yidongnan/grpc-spring-boot-starter[Grpc Spring Boot Starter]
|
||||
[[sleuth-rxjava-integration]]
|
||||
== RxJava
|
||||
|
||||
This feature is available for both Brave and OpenTelemetry tracer implementation.
|
||||
This feature is available for all tracer implementations.
|
||||
|
||||
We registering a custom https://github.com/ReactiveX/RxJava/wiki/Plugins#rxjavaschedulershook[`RxJavaSchedulersHook`] that wraps all `Action0` instances in their Sleuth representative, which is called `TraceAction`.
|
||||
The hook either starts or continues a span, depending on whether tracing was already going on before the Action was scheduled.
|
||||
@@ -559,7 +559,7 @@ IMPORTANT: The suggested approach to reactive programming and Sleuth is to use t
|
||||
[[sleuth-circuitbreaker-integration]]
|
||||
== Spring Cloud CircuitBreaker
|
||||
|
||||
This feature is available for both Brave and OpenTelemetry tracer implementation.
|
||||
This feature is available for all tracer implementations.
|
||||
|
||||
If you have Spring Cloud CircuitBreaker on the classpath, we will wrap the passed command `Supplier` and the fallback `Function` in its trace representations.
|
||||
In order to disable this instrumentation set `spring.sleuth.circuitbreaker.enabled` to `false`.
|
||||
@@ -21,7 +21,6 @@ To use the provided defaults you can set the `spring.sleuth.propagation.type` pr
|
||||
The value can be a list in which case you will propagate more tracing headers.
|
||||
|
||||
For Brave we support `AWS`, `B3`, `W3C` propagation types.
|
||||
For OpenTelemetry we support `AWS`, `B3`, `JAEGER`, `OT_TRACER` and `W3C` via the `io.opentelemetry:opentelemetry-extension-trace-propagators` dependency that you have to manually add to your classpath.
|
||||
|
||||
You can read more about how to provide custom context propagation in this "<<howto.adoc#how-to-change-context-propagation,how to section>>".
|
||||
|
||||
@@ -249,30 +248,6 @@ You can integrate with Brave and https://opentracing.io/[OpenTracing] via the
|
||||
`io.opentracing.brave:brave-opentracing` bridge.
|
||||
Just add it to the classpath and the OpenTracing `Tracer` will be set up automatically.
|
||||
|
||||
[[features-otel]]
|
||||
== OpenTelemetry Tracer Integration
|
||||
|
||||
Spring Cloud Sleuth integrates with the OpenTelemetry (OTel in short) SDK tracer via the bridge that is available in the `spring-cloud-sleuth-otel` module.
|
||||
In this section you can read about specific OTel integrations.
|
||||
|
||||
You can choose to use either Sleuth's API or the OpenTelemetry API directly in your code (e.g. either Sleuth's `Tracer` or OpenTelemetry's `Tracer`).
|
||||
If you want to use this tracer implementation's API directly please read https://github.com/open-telemetry/opentelemetry-java[their documentation to learn more about it].
|
||||
|
||||
[[features-otel-logging]]
|
||||
=== OpenTelemetry Logging Integration
|
||||
|
||||
We're providing an Slf4j integration via a `SpanProcessor` that injects to and removes entries (trace / span ids, baggage, tags etc.) from MDC. You can disable that via the `spring.sleuth.otel.log.slf4j.enabled=false` property.
|
||||
|
||||
If it's there on the classpath, we integrate with the `LoggingSpanExporter`.
|
||||
You can disable that integration via the `spring.sleuth.otel.log.exporter.enabled=false` property.
|
||||
|
||||
[[features-otel-opentracing]]
|
||||
=== OpenTelemetry Opentracing
|
||||
|
||||
You can integrate with OpenTelemetry and https://opentracing.io/[OpenTracing] via the
|
||||
`io.opentelemetry:opentelemetry-opentracing-shim` bridge.
|
||||
Just add it to the classpath and the OpenTracing `Tracer` will be set up automatically.
|
||||
|
||||
[[features-zipkin]]
|
||||
== Sending Spans to Zipkin
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@ If you are starting out with {project-full-name}, you should probably read the
|
||||
== Span Lifecycle with Spring Cloud Sleuth's API
|
||||
|
||||
Spring Cloud Sleuth Core in its `api` module contains all necessary interfaces to be implemented by a tracer.
|
||||
The project comes with OpenZipkin Brave and OpenTelemetry implementations.
|
||||
You can check how both tracers are bridged to the Sleuth's API by looking at the `org.springframework.cloud.sleuth.brave.bridge` and `org.springframework.cloud.sleuth.otel.bridge` modules respectively.
|
||||
The project comes with OpenZipkin Brave implementation.
|
||||
You can check how the tracers are bridged to the Sleuth's API by looking at the `org.springframework.cloud.sleuth.brave.bridge`.
|
||||
|
||||
The most commonly used interfaces are:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user