Skip to content

Commit

Permalink
Java docs: refer to v1.12.0, and some copyedits (#1193)
Browse files Browse the repository at this point in the history
* Java docs: refer to v1.12.0, and some copyedits

* Also get Gradle deps

* Partially revert gradle dep change per feedback
  • Loading branch information
chalin authored Mar 8, 2022
1 parent 70724c7 commit 24f3b01
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 36 deletions.
4 changes: 2 additions & 2 deletions content/en/docs/instrumentation/java/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ using our BOM to keep the versions of the various components in sync.
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-bom</artifactId>
<version>1.10.1</version>
<version>1.12.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -74,7 +74,7 @@ using our BOM to keep the versions of the various components in sync.

```kotlin
dependencies {
implementation(platform("io.opentelemetry:opentelemetry-bom:1.10.1"))
implementation(platform("io.opentelemetry:opentelemetry-bom:1.12.0"))
implementation("io.opentelemetry:opentelemetry-api")
}
```
Expand Down
2 changes: 1 addition & 1 deletion content/en/docs/instrumentation/java/annotations.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ library to use the `@WithSpan` annotation.
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-extension-annotations</artifactId>
<version>1.11.0</version>
<version>1.12.0</version>
</dependency>
</dependencies>
```
Expand Down
50 changes: 23 additions & 27 deletions content/en/docs/instrumentation/java/automatic.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,23 @@ app or service, use [Manual Instrumentation](../manual)

## Setup

Download the [latest
version](https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/).

The JAR file (`opentelemetry-javaagent.jar`) contains the agent and all
automatic instrumentation packages.

Place the JAR in your preferred directory and launch it with your app:

```
java -javaagent:path/to/opentelemetry-javaagent.jar \
-jar myapp.jar
```
1. Download the [latest release](../#releases). The JAR file
(`opentelemetry-javaagent.jar`) contains the agent and all automatic
instrumentation packages.
2. Place the JAR in your preferred directory and launch it with your app:
```sh
java -javaagent:path/to/opentelemetry-javaagent.jar \
-jar myapp.jar
```

## Configuring the agent

The agent is highly configurable.

One option is to pass configuration properties via the `D` flag. In this example
a service name and zipkin exporter for traces are configured:
One option is to pass configuration properties via the `-D` flag. In this
example, a service name and zipkin exporter for traces are configured:

```
```sh
java -javaagent:path/to/opentelemetry-javaagent.jar \
-Dotel.service.name=your-service-name \
-Dotel.traces.exporter=zipkin \
Expand All @@ -45,7 +41,7 @@ java -javaagent:path/to/opentelemetry-javaagent.jar \

You can also use environment variables to configure the agent:

```
```sh
OTEL_SERVICE_NAME=your-service-name \
OTEL_TRACES_EXPORTER=zipkin \
java -javaagent:path/to/opentelemetry-javaagent.jar \
Expand All @@ -54,29 +50,26 @@ java -javaagent:path/to/opentelemetry-javaagent.jar \

You can also supply a Java properties file and load configuration values from there:

```
```sh
java -javaagent:path/to/opentelemetry-javaagent.jar \
-Dotel.javaagent.configuration-file=path/to/properties/file.properties \
-jar myapp.jar
```

or

```
```sh
OTEL_JAVAAGENT_CONFIGURATION_FILE=path/to/properties/file.properties \
java -javaagent:path/to/opentelemetry-javaagent.jar \
-jar myapp.jar
```

To see the full range of configuration options, see [Agent
Configuration](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/agent-config.md)
To see the full range of configuration options, see [Agent Configuration][].

## Supported libraries, frameworks, application services, and JVMs

Many popular components support automatic instrumentation. See [Supported
libraries, frameworks, application services, and
JVMs](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/supported-libraries.md)
for the full list.
Many popular components support automatic instrumentation. For the full list,
see [Supported libraries, frameworks, application services, and JVMs][support].

## Troubleshooting

Expand All @@ -85,6 +78,9 @@ debug logs. Note that these are quite verbose.

## Next steps

After you have automatic instrumentation configured for your app or service,
you might want to [annotate](../annotations) selected methods or add [manual instrumentation](../manual) to collect
custom telemetry data.
After you have automatic instrumentation configured for your app or service, you
might want to [annotate](../annotations) selected methods or add [manual
instrumentation](../manual) to collect custom telemetry data.

[Agent Configuration]: https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/agent-config.md
[support]: https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/supported-libraries.md
8 changes: 4 additions & 4 deletions content/en/docs/instrumentation/java/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ Checkout
[boot-opentelemetry-tempo](https://github.com/mnadeem/boot-opentelemetry-tempo)
and get started

````console
```console
$ mvn clean package docker:build
````
```

````console
```console
$ docker-compose up
````
```
4 changes: 2 additions & 2 deletions content/en/docs/instrumentation/java/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,7 @@ try (Scope scope = outGoing.makeCurrent()) {

Similarly, the text-based approach can be used to read the W3C Trace Context
from incoming requests. The following presents an example of processing an
incoming HTTP request using
[HttpExchange](https://docs.oracle.com/javase/8/docs/jre/api/net/httpserver/spec/com/sun/net/httpserver/HttpExchange.html).
incoming HTTP request using [HttpExchange][].

```java
TextMapGetter<HttpExchange> getter =
Expand Down Expand Up @@ -563,6 +562,7 @@ io.opentelemetry.sdk.trace.export.BatchSpanProcessor = io.opentelemetry.extensio

[AlwaysOffSampler]: https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/samplers/AlwaysOffSampler.java
[AlwaysOnSampler]: https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/samplers/AlwaysOnSampler.java
[HttpExchange]: https://docs.oracle.com/javase/8/docs/jre/api/net/httpserver/spec/com/sun/net/httpserver/HttpExchange.html
[Instrumentation Library]: {{< relref "/docs/reference/specification/glossary#instrumentation-library" >}}
[instrumented library]: {{< relref "/docs/reference/specification/glossary#instrumented-library" >}}
[Library Guidelines]: {{< relref "/docs/reference/specification/library-guidelines" >}}
Expand Down

0 comments on commit 24f3b01

Please sign in to comment.