diff --git a/README.md b/README.md index 218ae7f348..eb0c76b6b7 100644 --- a/README.md +++ b/README.md @@ -257,7 +257,29 @@ only supports manual instrumentation using the `opentelemetry-api` version with number as the Java agent you are using. Starting with 1.0.0, the Java agent will start supporting multiple (1.0.0+) versions of `opentelemetry-api`. -You can use the OpenTelemetry `getTracer` or the `@WithSpan` annotation to +You'll need to add a dependency on the `opentelemetry-api` library to get started. + +### Maven + +```xml + + + io.opentelemetry + opentelemetry-api + 0.7.0 + + +``` + +### Gradle + +```groovy +dependencies { + compile('io.opentelemetry:opentelemetry-api:0.7.0') +} +``` + +Now you can use the OpenTelemetry `getTracer` or the `@WithSpan` annotation to manually instrument your Java application. ### Configure the OpenTelemetry getTracer @@ -284,6 +306,28 @@ public class MyClass { } ``` +You'll also need to add a dependency for this annotation: + +### Maven + +```xml + + + io.opentelemetry + opentelemetry-extension-auto-annotations + 0.7.0 + + +``` + +### Gradle + +```groovy +dependencies { + compile('io.opentelemetry:opentelemetry-extension-auto-annotations:0.7.0') +} +``` + Each time the application invokes the annotated method, it creates a span that denote its duration and provides any thrown exceptions.