Skip to content

Commit

Permalink
deprecated OpenTracing and use OTLP exporter as a default (#44)
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Kral <[email protected]>

Signed-off-by: Lukas Kral <[email protected]>
  • Loading branch information
im-konge committed Nov 28, 2022
1 parent 7748e8a commit 489dafd
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
10 changes: 7 additions & 3 deletions tracing/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Tracing

Currently this `tracing` module supports two different tracing abstractions
* OpenTracing
* OpenTracing (deprecated)
* OpenTelemetry

where both use `Jaeger` as the actual tracing implementation.

Actual tracing usage is triggered by specific `service name` env var usage.
For specifying, which `tracing` type should be used, the `TRACING_TYPE` environment variable has to be specified.
The value corresponds to abstraction names - `OpenTracing` or `OpenTelemetry`.

List of env vars we need to set:

Expand All @@ -17,4 +18,7 @@ List of env vars we need to set:
#### OpenTelemetry
* OTEL_SERVICE_NAME -- this triggers OpenTelemetry tracing
* OTEL_EXPORTER_JAEGER_ENDPOINT -- url where the Jaeger traces are sent
* OTEL_TRACES_EXPORTER=jaeger (this is not required, as it's done by the run.sh script)
* OTEL_TRACES_EXPORTER=otlp (this is not required, as it's done by the code)
* for different exporter the `/tracing/pom.xml` has to be edited and you'll have to build new, custom images
* example of changing `OTLP` exporter to `Jaeger`
* `<artifactId>opentelemetry-exporter-otlp</artifactId>` -> `<artifactId>opentelemetry-exporter-jaeger</artifactId>`
2 changes: 1 addition & 1 deletion tracing/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-exporter-jaeger</artifactId>
<artifactId>opentelemetry-exporter-otlp</artifactId>
<version>${opentelemetry.version}</version>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public String getServiceName() {
System.setProperty(TracingConstants.OTEL_SERVICE_NAME_KEY, serviceName);
}
if (serviceName != null && System.getenv(TracingConstants.OTEL_TRACES_EXPORTER_ENV) == null) {
System.setProperty(TracingConstants.OTEL_TRACES_EXPORTER_KEY, TracingConstants.JAEGER);
System.setProperty(TracingConstants.OTEL_TRACES_EXPORTER_KEY, TracingConstants.OTLP_EXPORTER);
}
return serviceName;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.util.Map;
import java.util.Properties;

@Deprecated
public class OpenTracingHandle implements TracingHandle {
@Override
public String getType() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public final class TracingConstants {
public static final String TEST_CLIENTS = "test-clients";

/**
* Common constants for Jaeger etc.
* Exporter related constants
*/
public static final String JAEGER = "jaeger";
public static final String OTLP_EXPORTER = "otlp";
}

0 comments on commit 489dafd

Please sign in to comment.