diff --git a/content/en/docs/instrumentation/java/libraries.md b/content/en/docs/instrumentation/java/libraries.md index c424ce6cd443..b6be7a43a222 100644 --- a/content/en/docs/instrumentation/java/libraries.md +++ b/content/en/docs/instrumentation/java/libraries.md @@ -26,16 +26,18 @@ Follow the instructions of each instrumentation library to set them up. ## Example app preparation {#example-app} -We will instrument an HTTP client application using library instrumentation which will make a call to HTTP server. +We will instrument an HTTP client application using library instrumentation +which will make a call to HTTP server. You can use the dice example app as HTTP server from -[Getting Started](/docs/instrumentation/java/getting-started/) or you can create your own HTTP server. +[Getting Started](/docs/instrumentation/java/getting-started/) or you can create +your own HTTP server. ### Dependencies {#example-app-dependencies} -To begin, set up an environment in a new directory called `java-simple-http-client`. Within -that directory, create a file called `build.gradle.kts` with the following -content: +To begin, set up an environment in a new directory called +`java-simple-http-client`. Within that directory, create a file called +`build.gradle.kts` with the following content: ```kotlin plugins { @@ -69,7 +71,8 @@ dependencies { ### Setup {#example-app-setup} -As an example, here's how you can instrument external API calls using [Java HTTP client library](https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/java-http-client/library). +As an example, here's how you can instrument external API calls using +[Java HTTP client library](https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/java-http-client/library). ```java // ExampleConfiguration.java @@ -173,18 +176,24 @@ export EXTERNAL_API_ENDPOINT=http://localhost:8080/rolldice ### Run example app {#example-app-run} -Run `source .env` to export environment variables, by default it will point to `http://localhost:8080/rolldice` where [example dice app](/docs/instrumentation/java/getting-started/#example-application) is running. +Run `source .env` to export environment variables, by default it will point to +`http://localhost:8080/rolldice` where +[example dice app](/docs/instrumentation/java/getting-started/#example-application) +is running. -When you run this code `gradle run`, the instrumentation libraries will +When you run this code `gradle run`, the instrumentation libraries will - Start a new trace - Generate a span representing the request made to the external API endpoint -- If you will use instrumented HTTP server eg. [example dice app](/docs/instrumentation/java/getting-started/#example-application) then more trace span will be generated which will have same trace id. +- If you will use instrumented HTTP server eg. + [example dice app](/docs/instrumentation/java/getting-started/#example-application) + then more trace span will be generated which will have same trace ID. ## Available instrumentation libraries A full list of instrumentation libraries produced by OpenTelemetry is available -here [opentelemetry-java-instrumentation](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/supported-libraries.md#libraries--frameworks). +here +[opentelemetry-java-instrumentation](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/supported-libraries.md#libraries--frameworks). ## Next steps @@ -193,10 +202,10 @@ After you have set up instrumentation libraries, you may want to add telemetry data. You'll also want to configure an appropriate exporter to -[export your telemetry data](/docs/instrumentation/java/exporters) to one or more -telemetry backends. +[export your telemetry data](/docs/instrumentation/java/exporters) to one or +more telemetry backends. You can also check the [automatic instrumentation for Java](/docs/instrumentation/java/automatic). -[opentelemetry-java]: https://github.com/open-telemetry/opentelemetry-java +[opentelemetry-java](https://github.com/open-telemetry/opentelemetry-java)