Add maven/gradle documentation to manual instrumentation instructions. (#1034)
* Add maven/gradle documentation to manual instrumentation instructions. * Run :spotlessApply on the README * Also add dependency description about the auto annotation
This commit is contained in:
parent
c9887ec048
commit
969a7c6c51
46
README.md
46
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
|
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`.
|
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
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.opentelemetry</groupId>
|
||||||
|
<artifactId>opentelemetry-api</artifactId>
|
||||||
|
<version>0.7.0</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
```
|
||||||
|
|
||||||
|
### 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.
|
manually instrument your Java application.
|
||||||
|
|
||||||
### Configure the OpenTelemetry getTracer
|
### Configure the OpenTelemetry getTracer
|
||||||
|
@ -284,6 +306,28 @@ public class MyClass {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
You'll also need to add a dependency for this annotation:
|
||||||
|
|
||||||
|
### Maven
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.opentelemetry</groupId>
|
||||||
|
<artifactId>opentelemetry-extension-auto-annotations</artifactId>
|
||||||
|
<version>0.7.0</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
```
|
||||||
|
|
||||||
|
### 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
|
Each time the application invokes the annotated method, it creates a span
|
||||||
that denote its duration and provides any thrown exceptions.
|
that denote its duration and provides any thrown exceptions.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue