Skip to content

Commit

Permalink
Enable Prettier check over instrumentation/java (#2363)
Browse files Browse the repository at this point in the history
  • Loading branch information
chalin committed Feb 20, 2023
1 parent 8120fdb commit 1ff41b1
Show file tree
Hide file tree
Showing 8 changed files with 317 additions and 266 deletions.
1 change: 0 additions & 1 deletion .prettierignore
Expand Up @@ -23,7 +23,6 @@ package-lock.json
content/en/docs/instrumentation/cpp
content/en/docs/instrumentation/erlang
content/en/docs/instrumentation/go
content/en/docs/instrumentation/java
content/en/docs/instrumentation/js
content/en/docs/instrumentation/net
content/en/docs/instrumentation/other
Expand Down
6 changes: 3 additions & 3 deletions content/en/docs/instrumentation/java/_index.md
Expand Up @@ -3,8 +3,7 @@ title: Java
description: >-
<img width="35" class="img-initial"
src="https://raw.githubusercontent.com/open-telemetry/opentelemetry.io/main/iconography/32x32/Java_SDK.svg"
alt="Java"></img>
A language-specific implementation of OpenTelemetry in Java.
alt="Java"></img> A language-specific implementation of OpenTelemetry in Java.
aliases: [/java, /java/metrics, /java/tracing]
weight: 18
cascade:
Expand Down Expand Up @@ -73,6 +72,7 @@ dependencies {
```

[maven central]: https://mvnrepository.com/artifact/io.opentelemetry
[opentelemetry-java-docs]: https://github.com/open-telemetry/opentelemetry-java-docs#java-opentelemetry-examples
[opentelemetry-java-docs]:
https://github.com/open-telemetry/opentelemetry-java-docs#java-opentelemetry-examples
[releases]: https://github.com/open-telemetry/opentelemetry-java/releases
[components]: https://github.com/open-telemetry/opentelemetry-java#releases
48 changes: 27 additions & 21 deletions content/en/docs/instrumentation/java/automatic/_index.md
Expand Up @@ -17,20 +17,21 @@ service or app code, see [Manual instrumentation](../manual).

## Setup

1. Download [opentelemetry-javaagent.jar][] from [Releases][] of the
`opentelemetry-java-instrumentation` repo and place the JAR in your preferred directory.
The JAR file contains the agent and instrumentation libraries.
2. Add `-javaagent:path/to/opentelemetry-javaagent.jar` and other config
to your JVM's startup arguments and launch your app:
1. Download [opentelemetry-javaagent.jar][] from [Releases][] of the
`opentelemetry-java-instrumentation` repo and place the JAR in your
preferred directory. The JAR file contains the agent and instrumentation
libraries.
2. Add `-javaagent:path/to/opentelemetry-javaagent.jar` and other config to
your JVM's startup arguments and launch your app:
- Directly on the startup command:
```console
$ java -javaagent:path/to/opentelemetry-javaagent.jar -Dotel.service.name=your-service-name -jar myapp.jar
```shell
java -javaagent:path/to/opentelemetry-javaagent.jar -Dotel.service.name=your-service-name -jar myapp.jar
```
- Via the `JAVA_TOOL_OPTIONS` and other environment variables:
```console
$ export JAVA_TOOL_OPTIONS="-javaagent:path/to/opentelemetry-javaagent.jar"
$ export OTEL_SERVICE_NAME="your-service-name"
$ java -jar myapp.jar
```shell
export JAVA_TOOL_OPTIONS="-javaagent:path/to/opentelemetry-javaagent.jar"
export OTEL_SERVICE_NAME="your-service-name"
java -jar myapp.jar
```

## Configuring the agent
Expand All @@ -56,7 +57,8 @@ java -javaagent:path/to/opentelemetry-javaagent.jar \
-jar myapp.jar
```

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

```sh
java -javaagent:path/to/opentelemetry-javaagent.jar \
Expand All @@ -76,8 +78,9 @@ To see the full range of configuration options, see [Agent Configuration][].

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

The Java agent ships with instrumentation libraries for many popular components.
For the full list, see [Supported libraries, frameworks, application services, and JVMs][support].
The Java agent ships with instrumentation libraries for many popular components.
For the full list, see [Supported libraries, frameworks, application services,
and JVMs][support].

## Troubleshooting

Expand All @@ -87,10 +90,13 @@ 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.

[Agent Configuration]: agent-config
[opentelemetry-javaagent.jar]: https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/opentelemetry-javaagent.jar
[releases]: https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases
[support]: https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/supported-libraries.md
might want to [annotate](annotations) selected methods or add
[manual instrumentation](../manual) to collect custom telemetry data.

[agent configuration]: agent-config
[opentelemetry-javaagent.jar]:
https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/opentelemetry-javaagent.jar
[releases]:
https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases
[support]:
https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/supported-libraries.md

0 comments on commit 1ff41b1

Please sign in to comment.