Skip to content
OpenTelemetry Auto-Instrumentation for Java
Java Groovy Scala Shell Kotlin HTML
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci Rename java agent artifact (#137) Feb 7, 2020
agent-bootstrap Update to OpenTelemetry API/SDK 0.3.0 (#286) Mar 29, 2020
agent-tooling Update to OpenTelemetry API/SDK 0.3.0 (#286) Mar 29, 2020
benchmark-integration Update to OpenTelemetry API/SDK 0.3.0 (#286) Mar 29, 2020
benchmark Update to OpenTelemetry API/SDK 0.3.0 (#286) Mar 29, 2020
buildSrc Fix file formatting (#256) Mar 20, 2020
exporter-adapters Update to OpenTelemetry API/SDK 0.3.0 (#286) Mar 29, 2020
gradle Update to OpenTelemetry API/SDK 0.3.0 (#286) Mar 29, 2020
instrumentation Update to OpenTelemetry API/SDK 0.3.0 (#286) Mar 29, 2020
java-agent Update to OpenTelemetry API/SDK 0.3.0 (#286) Mar 29, 2020
load-generator Update to OpenTelemetry API/SDK 0.3.0 (#286) Mar 29, 2020
opentelemetry-api-shaded-for-instrumenting Update to OpenTelemetry API/SDK 0.3.0 (#286) Mar 29, 2020
opentelemetry-sdk-shaded-for-testing Rename boostrap and tooling modules (#146) Feb 8, 2020
smoke-tests Update to OpenTelemetry API/SDK 0.3.0 (#286) Mar 29, 2020
testing Update to OpenTelemetry API/SDK 0.3.0 (#286) Mar 29, 2020
utils Update thread names (#231) Mar 16, 2020
.editorconfig Make editorconfig windows friendly (#250) Mar 19, 2020
.gitignore Merge remote-tracking branch 'datadog/master' into dd-merge Feb 22, 2020
CODEOWNERS Update Seva's github username (#35) Dec 4, 2019
CONTRIBUTING.md Merge tag 'v0.45.0' into dd-merge Mar 6, 2020
LICENSE Update to standard LICENSE file for OpenTelemetry (#19) Nov 19, 2019
LICENSE-3rdparty.csv Rename package to io.opentelemetry.auto (#54) Jan 14, 2020
README.md Add instrumented libraries/frameworks to README (#284) Mar 28, 2020
gradle.properties Try doubling the metaspace size to fix check task. Jan 4, 2019
gradlew Upgradle to gradle 6.0 Nov 12, 2019
gradlew.bat Update gradle to 5.5.1 Jul 12, 2019
settings.gradle Update to OpenTelemetry API/SDK 0.3.0 (#286) Mar 29, 2020
trace-java.gradle Integrate SpotBugs into build (ignoreFailures=true), fix most found i… Mar 9, 2020

README.md

OpenTelemetry Auto-Instrumentation for Java

Notice - Work in Progress!

This project is still in the early phases of development and is not yet stable. You are welcome to experiment with it, but we strongly discourage any production use!

Introduction

This project uses a technique known as bytecode instrumentation to add tracing to a Java application. Simply put, we provide a Java agent that can be attached to any Java 7+ application and dynamically adds code to enable tracing.

Supported Java libraries and frameworks

Library/Framework Versions
Akka HTTP 10.0+
Apache HttpAsyncClient 4.0+
Apache HttpClient 2.0+
AWS SDK 1.11.x and 2.2.0+
Cassandra Driver 3.0+ (not including 4.x yet)
Couchbase Client 2.0+ (not including 3.x yet)
Dropwizard Views 0.7+
Elasticsearch API 2.0+ (not including 7.x yet)
Elasticsearch REST Client 5.0+
Finatra 2.9+
Geode Client 1.4+
Google HTTP Client 1.19+
Grizzly 2.0+
gRPC 1.5+
Hibernate 3.3+
HttpURLConnection Java 7+
Hystrix 1.4+
java.util.logging Java 7+
JAX-RS 0.5+
JAX-RS Client 2.0+
JDBC Java 7+
Jedis 1.4+
Jetty 8.0+
JMS 1.1+
JSP 2.3+
Kafka 0.11+
Lettuce 5.0+
Log4j 1.1+
Logback 1.0+
MongoDB Drivers 3.3+
Netty 4.0+
OkHttp 3.0+
Play 2.4+ (not including 2.8.x yet)
Play WS 1.0+
Project Reactor 3.1+
RabbitMQ Client 2.7+
Ratpack 1.4+
RMI Java 7+
RxJava 1.0+
Servlet 2.3+
Spark Web Framework 2.3+
Spring Data 1.8+
Spring Scheduling 3.1+
Spring Servlet MVC 3.1+
Spring Webflux 5.0+
Spymemcached 2.12+
Twilio 6.6+

Using the agent

As mentioned above, this project is in a very early phase of development and not yet stable. However, you can try it on your Java application by following these instructions.

Download and run

Download the latest release.

The instrumentation agent is enabled using the -javaagent flag to the JVM. Configuration parameters are passed as Java system properties (-D flags) or as environment variables. This is an example:

java -javaagent:/path/to/opentelemetry-auto-<version>.jar \
     -Dota.exporter.jar=exporter-adapters/logging-exporter-adapter/build/libs/logging-exporter-adapter-0.1.2-SNAPSHOT.jar \
     -Dota.jaeger.host=localhost \
     -Dota.jaeger.port=14250 \
     -Dota.service=shopping \
     -jar myapp.jar

Configuration parameters (subject to change!)

System property Environment variable Purpose
ota.exporter.jar OTA_EXPORTER_JAR The path to an exporter JAR
ota.service OTA_SERVICE The service name of this JVM instance. This is used as a label in Jaeger to distinguish between JVM instances in a multi-service environment.

Available exporters

Currently two exporters are available and bundled with this project. They area available under the exporter-adapters directory.

Logging Exporter

The logging exporter simply prints the name of the span along with its attributes to stdout. It is used manly for testing and debugging. It takes a single configuration parameter.

System property Environment variable Purpose
ota.exporter.logging.prefix OTA_EXPORTER_LOGGING_PREFIX A string that is printed in front of the span name and attributes.

Jaeger exporter

A simple wrapper for the Jaeger exporter of opentelemetry-java. It currently only supports gRPC as its communications protocol.

System property Environment variable Purpose
ota.exporter.jaeger.host OTA_EXPORTER_JAEGER_HOST The Jaeger host to connect to. Currently only gRPC is supported.
ota.exporter.jaeger.port OTA_EXPORTER_JAEGER_PORT The port to connect to on the Jaeger host. Currently only gRPC is supported

These parameter names are very likely to change over time, so please check back here when trying out a new version!

Please report any bugs or unexpected behavior you may find.

Building from source

Build using Java 8:

gradle assemble

and then you can find the java agent artifact at java-agent/build/lib/opentelemetry-auto-<version>.jar.

You can’t perform that action at this time.