diff --git a/README.md b/README.md index 565905071d..7a35020f0b 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,28 @@ # Java OpenTelemetry Examples -This module contains a set of fully-functional, working examples of using the -OpenTelemetry Java APIs and SDK that should all be able to be run locally. Some -of them assume you have docker running on your local machine. +This repository contains a set of fully functional, working examples of using the +OpenTelemetry Java APIs and SDK. All examples can be run locally. Some +examples require Docker to be running on your local machine. -## Example modules: +## Requirements + +Java 17 or higher is required to build the examples in this repository. +To check your Java version, run: + +```bash +java -version +``` + +To build the all of examples, run: + +```bash +./gradlew assemble +``` + +## Example Modules - [Using the SDK AutoConfiguration module](autoconfigure) - - This module contains a fully-functional example of using the autoconfigure + - This module contains a fully functional example of using the autoconfigure SDK extension module to configure the SDK using only environment variables (or system properties). - Note: the `opentelemetry-sdk-extension-autoconfigure` module is still @@ -15,7 +30,7 @@ of them assume you have docker running on your local machine. - [Manual instrumentation of HTTP](http) - This module provides an example of writing manual instrumentation for HTTP, both client and server. - - Note more production-ready instrumentation for HTTP is provided as a part + - Note: More production-ready instrumentation for HTTP is provided as part of the [OpenTelemetry Java Instrumentation](https://github.com/open-telemetry/opentelemetry-java-instrumentation) project. - [Manual span creation and baggage propagation](manual-tracing) @@ -24,53 +39,53 @@ of them assume you have docker running on your local machine. - Additionally, it demonstrates how to use the OpenTelemetry API to propagate baggage items. - [Configuring the Jaeger Exporter](jaeger) - - This module contains a fully-functional example of configuring the - OpenTelemetry SDK to use a Jaeger exporter, and send some spans to it + - This module contains a fully functional example of configuring the + OpenTelemetry SDK to use a Jaeger exporter and send spans to it using the OpenTelemetry API. - - Note: this example requires having docker installed to run the example. + - Note: This example requires Docker to be installed. - [Using the OpenTelemetry Java Agent](javaagent) - This module demonstrates using the OpenTelemetry Java Agent with a simple - spring boot application. Traces, metrics, and logs are exported to a + Spring Boot application. Traces, metrics, and logs are exported to a collector via OTLP. - [Spring native image telemetry with OpenTelemetry Spring Starter](spring-native) - This module demonstrates using the OpenTelemetry Spring Boot starter with a - Graal VM native image. Traces and metrics are exported to a collector via OTLP. + GraalVM native image. Traces and metrics are exported to a collector via OTLP. - [Configuring Log Appenders](log-appender) - This module demonstrates how to configure the Log4j and Logback appenders to bridge logs into the OpenTelemetry Log SDK. - [Configuring the Logging Exporters](logging) - - This module contains a fully-functional example of configuring the + - This module contains a fully functional example of configuring the OpenTelemetry SDK to use a logging exporter. -- [Exporting Application logs using JSON logging in Kubernetes](logging-k8s-stdout-otlp-json) +- [Exporting application logs using JSON logging in Kubernetes](logging-k8s-stdout-otlp-json) - This module demonstrates how to export application logs using JSON logging in Kubernetes. - [Using the OpenTelemetry metrics API](metrics) - This module contains examples of using the OpenTelemetry metrics APIs. - [Using OpenTelemetry Micrometer shim](micrometer-shim) - - This module contains an example of a typical micrometer setup (spring boot - with spring boot actuator) configured to bridge metrics to OpenTelemetry - with the micrometer shim. - - Note: the micrometer shim is still experimental at this time. + - This module contains an example of a typical Micrometer setup (Spring Boot + with Spring Boot Actuator) configured to bridge metrics to OpenTelemetry + with the Micrometer shim. + - Note: The Micrometer shim is still experimental at this time. - [Setting up OTLP exporters](otlp) - - OTLP is the OpenTelemetry Protocol. This module will demonstrate how to - configure the OTLP exporters, and send data to the OpenTelemetry collector + - OTLP is the OpenTelemetry Protocol. This module demonstrates how to + configure the OTLP exporters and send data to the OpenTelemetry Collector using them. - - Note: this example requires having docker installed to run the example. + - Note: This example requires Docker to be installed. - [Setting up the Prometheus exporter](prometheus) - - The module shows how to configure the OpenTelemetry SDK to expose an + - This module shows how to configure the OpenTelemetry SDK to expose an endpoint that can be scraped by Prometheus. - - Note: the prometheus metric reader is still experimental at this time. + - Note: The Prometheus metric reader is still experimental at this time. - [Manually Configuring the SDK](sdk-usage) - - This module shows some concrete examples of manually configuring the Java - OpenTelemetry SDK for Tracing. + - This module shows some concrete examples of manually configuring the + OpenTelemetry SDK for tracing. - [Telemetry Testing](telemetry-testing) - - This module demonstrates how to test OpenTelemetry instrumentation with a + - This module demonstrates how to test OpenTelemetry instrumentation with MockServer. - [Setting up the Zipkin exporter](zipkin) - - This module contains a fully-functional example of configuring the - OpenTelemetry SDK to use a Zipkin exporter, and send some spans to a - zipkin backend using the OpenTelemetry API. - - Note: this example requires having docker installed to run the example. + - This module contains a fully functional example of configuring the + OpenTelemetry SDK to use a Zipkin exporter and send spans to a + Zipkin backend using the OpenTelemetry API. + - Note: This example requires Docker to be installed. ## Contributing diff --git a/autoconfigure/README.md b/autoconfigure/README.md index c1753dd5ab..5363a4e16a 100644 --- a/autoconfigure/README.md +++ b/autoconfigure/README.md @@ -1,4 +1,4 @@ -# SDK autoconfiguration example +# SDK Autoconfiguration Example This is a simple example that demonstrates the usage of the [OpenTelemetry SDK Autoconfigure](https://github.com/open-telemetry/opentelemetry-java/tree/main/sdk-extensions/autoconfigure) @@ -6,11 +6,12 @@ module. ## Prerequisites -* Java 1.8 +* Java 17 or higher is required to run Gradle and build this example +* Java 8 or higher may be used to run the example once it has been built -## How to run +## How to Run -First build this example application: +First, build this example application: ```shell ../gradlew shadowJar diff --git a/declarative-configuration/README.md b/declarative-configuration/README.md index 059c9802bc..50d0afaf30 100644 --- a/declarative-configuration/README.md +++ b/declarative-configuration/README.md @@ -4,11 +4,12 @@ This example demonstrates how to use [declarative configuration](https://opentel The configuration file is located at [otel-sdk-config.yaml](./otel-sdk-config.yaml). -# How to run +# How to Run ## Prerequisites -* Java 1.8 +* Java 17 or higher is required to run Gradle and build this example +* Java 8 or higher may be used to run the example once it has been built ## Run @@ -19,4 +20,4 @@ export OTEL_EXPERIMENTAL_CONFIG_FILE=$(pwd)/otel-sdk-config.yaml Observe how data is printed to the console as configured in [otel-sdk-config.yaml](./otel-sdk-config.yaml). -For use with the OpenTelemetry Java, see [Java Agent declarative configuration](../javaagent/README.md#declarative-configuration). +For use with the OpenTelemetry Java Agent, see [Java Agent declarative configuration](../javaagent/README.md#declarative-configuration). diff --git a/grpc/README.md b/grpc/README.md index e9279a4cb7..a5f75ab531 100644 --- a/grpc/README.md +++ b/grpc/README.md @@ -1,17 +1,22 @@ -# GRPC Example +# gRPC Example **Note:** This is an advanced scenario useful for people who want to *manually* instrument their own code. -(If you're using the [java agent](https://github.com/open-telemetry/opentelemetry-java-instrumentation), you get this instrumentation "out-of-the-box" and this isn't necessary.) +(If you're using the [Java agent](https://github.com/open-telemetry/opentelemetry-java-instrumentation), you get this instrumentation "out-of-the-box" and this isn't necessary.) This is a simple example that demonstrates how to use the OpenTelemetry SDK -to *manually* instrument a simple GRPC based Client/Server application. +to *manually* instrument a simple gRPC-based client/server application. This example utilizes the [opentelemetry-grpc-1.6](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/instrumentation/grpc-1.6/library/README.md#library-instrumentation-for-grpc-160) -to instrument both the GRPC client and server. +library to instrument both the gRPC client and server. -# How to run +# How to Run ## Prerequisites -* Be on the grpc project root folder + +* Java 17 or higher is required to run Gradle and build this example +* Java 8 or higher may be used to run the example once it has been built + +Be in the gRPC project root folder: + ```shell script cd grpc/ ``` diff --git a/http/README.md b/http/README.md index 0853b313c7..17d002ef67 100644 --- a/http/README.md +++ b/http/README.md @@ -1,18 +1,19 @@ # HTTP Example -**Note:** This is an advanced scenario useful for people that want to *manually* instrument their own code. +**Note:** This is an advanced scenario useful for people who want to *manually* instrument their own code. -This is a simple example that demonstrates how to use the OpenTelemetry SDK -to *manually* instrument a simple HTTP based Client/Server application. -The example creates the **Root Span** on the client and sends the context +This is a simple example that demonstrates how to use the OpenTelemetry SDK +to *manually* instrument a simple HTTP-based client/server application. +The example creates the **root span** on the client and sends the context over the HTTP request. On the server side, the example shows how to extract the context -and create a **Child Span** with attached a **Span Event**. +and create a **child span** with an attached **span event**. -# How to run +# How to Run ## Prerequisites -* Java 1.8.231 -* Be on the project root folder + +* Java 17 or higher is required to run Gradle and build this example +* Java 8 or higher may be used to run the example once it has been built ## 1 - Compile ```shell script diff --git a/jaeger/README.md b/jaeger/README.md index 05418ca5ed..dfb0a744a5 100644 --- a/jaeger/README.md +++ b/jaeger/README.md @@ -1,15 +1,16 @@ # Jaeger Example -This is a simple example that demonstrates how to use the OpenTelemetry SDK +This is a simple example that demonstrates how to use the OpenTelemetry SDK to instrument a simple application and export to a Jaeger backend. -# How to run +# How to Run ## Prerequisites -* Java 1.8+ -* Docker 19.03 -* Jaeger 1.16 - [Link][jaeger] +* Java 17 or higher is required to run Gradle and build this example +* Java 8 or higher may be used to run the example once it has been built +* Docker +* Jaeger 1.16 or higher ## 1 - Compile ```shell script diff --git a/javaagent/README.md b/javaagent/README.md index 1a93d96c82..ab3a0f7caf 100644 --- a/javaagent/README.md +++ b/javaagent/README.md @@ -3,58 +3,58 @@ This example demonstrates simple usage of the OpenTelemetry Java Agent published by [opentelemetry-java-instrumentation](https://github.com/open-telemetry/opentelemetry-java-instrumentation). -It consists of a spring boot application with: +It consists of a Spring Boot application with: -- A gradle task for downloading the OpenTelemetry Java Agent. +- A Gradle task for downloading the OpenTelemetry Java Agent - A simple web API available at `GET http://localhost:8080/ping`. When called, - auto instrumentation from the OpenTelemetry Java Agent records spans and + auto-instrumentation from the OpenTelemetry Java Agent records spans and metrics. Additionally, there is manual trace and metric instrumentation, as - well as application logging performed in the context of traces using the log4j - API. -- A docker compose setup configured to run the application and export to - the [collector](https://opentelemetry.io/docs/collector/) via OTLP. -- The collector is configured with + well as application logging performed in the context of traces using the Log4j + API +- A Docker Compose setup configured to run the application and export to + the [Collector](https://opentelemetry.io/docs/collector/) via OTLP +- The Collector is configured with the [OTLP receiver](https://github.com/open-telemetry/opentelemetry-collector/tree/main/receiver/otlpreceiver) - and export it to standard out with + and exports to standard out with the [logging exporter](https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/debugexporter) ## Prerequisites -* Java 1.8 -* Docker compose +* Java 17 or higher is required to build and run this example +* Docker Compose -# How to run +# How to Run -Build the application jar +Build the application jar: ```shell ../gradlew bootJar ``` -Run the application and the collector with docker compose +Run the application and the Collector with Docker Compose: ```shell -docker-compose up --build +docker compose up --build ``` -In a separate shell, exercise the application by calling its endpoint +In a separate shell, exercise the application by calling its endpoint: ```shell curl http://localhost:8080/ping ``` -Watch for spans, metrics, and logs in the collector log output +Watch for spans, metrics, and logs in the Collector log output. ## Declarative Configuration -By default, this example uses the [environment variable configuration schema](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md) to configure the SDK. However, it also includes [sdk-config.yaml](./sdk-config.yaml) which demonstrates how the [declarative configuration](https://opentelemetry.io/docs/specs/otel/configuration/#declarative-configuration) scheme can be used to configure the SDK based on a YAML configuration file instead. +By default, this example uses the [environment variable configuration schema](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md) to configure the SDK. However, it also includes [sdk-config.yaml](./sdk-config.yaml) which demonstrates how the [declarative configuration](https://opentelemetry.io/docs/specs/otel/configuration/#declarative-configuration) scheme can be used to configure the SDK based on a YAML configuration file instead. `sdk-config.yaml` extends the [opentelemetry-configuration sdk-config.yaml](https://github.com/open-telemetry/opentelemetry-configuration/blob/v0.3.0/examples/sdk-config.yaml) template, demonstrating: -- Configuration of instrumentation (see `.instrumentation.java`) -- Configuration of [rule based routing sampler](https://github.com/open-telemetry/opentelemetry-java-contrib/tree/main/samplers) (see `.tracer_provider.sampler.parent_based.root`) +- Configuration of instrumentation (see `.instrumentation.java`) +- Configuration of [rule-based routing sampler](https://github.com/open-telemetry/opentelemetry-java-contrib/tree/main/samplers) (see `.tracer_provider.sampler.parent_based.root`) -To use declarative configuration instead of the environment variable scheme, add the following before starting the application and collector: +To use declarative configuration instead of the environment variable scheme, add the following before starting the application and Collector: ```shell export OTEL_EXPERIMENTAL_CONFIG_FILE=/sdk-config.yaml diff --git a/kotlin-extension/README.md b/kotlin-extension/README.md index 1a855ee3ee..19f1c39089 100644 --- a/kotlin-extension/README.md +++ b/kotlin-extension/README.md @@ -1,15 +1,16 @@ -# Kotlin Extension examples +# Kotlin Extension Examples -This is a simple example that demonstrates how to use the Kotlin extension for attaching a Span context to a Kotlin +This is a simple example that demonstrates how to use the Kotlin extension for attaching a span context to a Kotlin coroutine. ## Prerequisites -* Java 1.8 or higher +* Java 17 or higher is required to run Gradle and build this example +* Java 8 or higher may be used to run the example once it has been built ## Compile -Compile with +Compile with: ```shell script ../gradlew shadowJar @@ -17,7 +18,7 @@ Compile with ## Run -The following commands are used to run the examples. +Use the following command to run the example: ```shell script java -cp build/libs/kotlin-extension-0.1.0-SNAPSHOT-all.jar io.opentelemetry.example.kotlinextension.Application diff --git a/log-appender/README.md b/log-appender/README.md index eac9529ef2..d715c7aba9 100644 --- a/log-appender/README.md +++ b/log-appender/README.md @@ -1,43 +1,44 @@ # OpenTelemetry Log Appender Example -This example demonstrates an application configured to use the OpenTelemetry Log -Appenders to bridge logs into the OpenTelemetry Log SDK, and export +This example demonstrates an application configured to use the OpenTelemetry log +appenders to bridge logs into the OpenTelemetry Log SDK and export via [OTLP](https://opentelemetry.io/docs/reference/specification/protocol/otlp/). Details about the example: * The OpenTelemetry Log SDK is configured to export data to - the [collector](https://opentelemetry.io/docs/collector/), which prints the - logs to the console. + the [Collector](https://opentelemetry.io/docs/collector/), which prints the + logs to the console * The application is configured with a variety of log solutions: * Log4j API [configured](./src/main/resources/log4j2.xml) to print logs to the console and - the [OpenTelemetry Log4J Appender](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/instrumentation/log4j/log4j-appender-2.17/library/README.md). + the [OpenTelemetry Log4j Appender](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/instrumentation/log4j/log4j-appender-2.17/library/README.md) * SLF4J API [configured with Logback](./src/main/resources/logback.xml) to print logs to the console and - the [OpenTelemetry Logback Appender](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/instrumentation/logback/logback-appender-1.0/library/README.md). - * [JUL to SLF4J](./build.gradle.kts), which bridges JUL logs to the SLF4J API, and - ultimately to Logback. + the [OpenTelemetry Logback Appender](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/instrumentation/logback/logback-appender-1.0/library/README.md) + * [JUL to SLF4J](./build.gradle.kts), which bridges JUL logs to the SLF4J API and + ultimately to Logback * Demonstrates how trace context is propagated to logs when recorded within a - span. + span ## Prerequisites -* Java 1.8 -* Docker compose +* Java 17 or higher is required to run Gradle and build this example +* Java 11 or higher is required to run the compiled example +* Docker Compose -# How to run +# How to Run -Run the collector via docker +Run the Collector via Docker: ```shell -docker-compose up +docker compose up ``` -In a separate shell, run the application +In a separate shell, run the application: ```shell ../gradlew run ``` -Watch the collector logs to see exported log records +Watch the Collector logs to see exported log records. diff --git a/micrometer-shim/README.md b/micrometer-shim/README.md index 4cb6f852cc..35e1c2d2a0 100644 --- a/micrometer-shim/README.md +++ b/micrometer-shim/README.md @@ -1,24 +1,30 @@ # Micrometer Shim Example This example demonstrates a typical use case -of [micrometer shim](https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/micrometer/micrometer-1.5/library). +of [Micrometer shim](https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/micrometer/micrometer-1.5/library). -It consists of a spring boot application with: +It consists of a Spring Boot application with: - A simple web API available at `GET http://localhost:8080/ping` -- Instrumented with the spring boot actuator and micrometer -- Micrometer metrics bridged to OpenTelemetry using the micrometer shim -- OpenTelemetry metrics exported with prometheus +- Instrumented with the Spring Boot Actuator and Micrometer +- Micrometer metrics bridged to OpenTelemetry using the Micrometer shim +- OpenTelemetry metrics exported with Prometheus -# How to run +# How to Run -Run the application +## Prerequisites + +* Java 17 or higher is required to build and run this example + +## Run + +Run the application: ```shell ../gradlew bootRun ``` -Exercise the application by calling its endpoint +Exercise the application by calling its endpoint: ```shell curl http://localhost:8080/ping diff --git a/otlp/README.md b/otlp/README.md index b675ac470a..bd26793bc3 100644 --- a/otlp/README.md +++ b/otlp/README.md @@ -1,14 +1,24 @@ -### Running the OTLP example +# OTLP Example -Assuming you're on a unix-alike (mac, linux, etc): +## Prerequisites + +* Java 17 or higher is required to run Gradle and build this example +* Java 8 or higher may be used to run the example once it has been built +* Docker Compose + +## How to Run + +Assuming you're on a Unix-like system (macOS, Linux, etc.): In a shell: + ```shell cd docker -docker-compose up +docker compose up ``` In a separate shell: + ```shell ../gradlew run ``` \ No newline at end of file diff --git a/otlp/docker/README.md b/otlp/docker/README.md index 4db17ee28d..7640f3dfee 100644 --- a/otlp/docker/README.md +++ b/otlp/docker/README.md @@ -2,12 +2,12 @@ *IMPORTANT:* This uses a pre-released version of the OpenTelemetry Collector. -This demo uses `docker-compose` and by default runs against the +This demo uses `docker compose` and by default runs against the `otel/opentelemetry-collector-dev:latest` image. To run the demo, switch to this directory and run: ```shell -docker-compose up -d +docker compose up -d ``` The demo exposes the following backends: @@ -21,5 +21,5 @@ Notes: - It may take some time for the application metrics to appear on the Prometheus dashboard; -To clean up any docker container from the demo run `docker-compose down` from +To clean up any docker container from the demo run `docker compose down` from this directory. diff --git a/prometheus/README.md b/prometheus/README.md index 447d6222b9..59b39dc377 100644 --- a/prometheus/README.md +++ b/prometheus/README.md @@ -4,16 +4,17 @@ This example demonstrates how to use the OpenTelemetry SDK to instrument a simple application using Prometheus as the metric exporter and expose the metrics via HTTP. -These are collected by a Prometheus instance which is configured to pull these +These metrics are collected by a Prometheus instance which is configured to scrape metrics via HTTP. -# How to run +# How to Run ## Prerequisites -* Java 1.7 +* Java 17 or higher is required to run Gradle and build this example +* Java 8 or higher may be used to run the example once it has been built * Docker 19.03 -* Docker compose +* Docker Compose ## 1 - Compile @@ -23,15 +24,15 @@ metrics via HTTP. ## 2 - Run -Start the application and prometheus via docker compose +Start the application and Prometheus via Docker Compose: ```shell -docker-compose up +docker compose up ``` -## 3 - View metrics +## 3 - View Metrics -To view metrics in prometheus, navigate to: +To view metrics in Prometheus, navigate to: http://localhost:9090/graph?g0.range_input=15m&g0.expr=incoming_messages&g0.tab=0 diff --git a/sdk-usage/README.md b/sdk-usage/README.md index 9f161f57bb..553602e2f2 100644 --- a/sdk-usage/README.md +++ b/sdk-usage/README.md @@ -1,20 +1,23 @@ # SDK Usage Examples -This is a simple example that demonstrates how to use and configure the OpenTelemetry SDK. +This is a simple example that demonstrates how to use and configure the OpenTelemetry SDK. ## Prerequisites -* Java 1.8 or higher +* Java 17 or higher is required to run Gradle and build this example +* Java 8 or higher may be used to run the example once it has been built ## Compile -Compile with + +Compile with: + ```shell script ../gradlew shadowJar ``` ## Run -The following commands are used to run the examples. +Use the following commands to run the examples: ```shell script java -cp build/libs/opentelemetry-examples-sdk-usage-0.1.0-SNAPSHOT-all.jar io.opentelemetry.sdk.example.ConfigureTraceExample ``` diff --git a/spring-native/README.md b/spring-native/README.md index 177701b370..484d76aa7c 100644 --- a/spring-native/README.md +++ b/spring-native/README.md @@ -4,18 +4,18 @@ This example demonstrates usage of the [OpenTelemetry Spring starter](https://op The example uses the following elements: -- A web API available at `GET http://localhost:8080/ping`. -- A docker compose setup configured to run the application and export to - the [collector](https://opentelemetry.io/docs/collector/) via OTLP. -- A collector configured with +- A web API available at `GET http://localhost:8080/ping` +- A Docker Compose setup configured to run the application and export to + the [Collector](https://opentelemetry.io/docs/collector/) via OTLP +- A Collector configured with the [OTLP receiver](https://github.com/open-telemetry/opentelemetry-collector/tree/main/receiver/otlpreceiver) - and exporting to the standard output with - the [logging exporter](https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/debugexporter). -- A spring configuration to suppress spans for the `/actuator` endpoint -- A spring configuration to set OTLP headers dynamically + and exporting to standard output with + the [logging exporter](https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/debugexporter) +- A Spring configuration to suppress spans for the `/actuator` endpoint +- A Spring configuration to set OTLP headers dynamically (not needed for the example - it shows how to configure exporters programmatically) -# Description of the instrumentation set-up +# Description of the Instrumentation Setup We have included the [OpenTelemetry Spring starter](https://opentelemetry.io/docs/zero-code/java/spring-boot-starter/) to instrument the HTTP calls, the logs, the SQL queries, and send the OpenTelemetry data via OTLP: @@ -25,28 +25,32 @@ We have included the [OpenTelemetry Spring starter](https://opentelemetry.io/doc ## Prerequisites -* GraalVM for Java 17 -* Docker compose +* Java 17 or higher is required to build and run this example +* GraalVM for Java 17 (required for native image compilation) +* Docker Compose -# How to run +# How to Run + +Build the GraalVM native image: -Build the GraalVM native image ```shell cd spring-native ../gradlew bootBuildImage --imageName=otel-native-graalvm ``` -Run the application and the collector with docker compose +Run the application and the Collector with Docker Compose: + ```shell -docker-compose up +docker compose up ``` -In a separate shell, exercise the application by calling its endpoint +In a separate shell, exercise the application by calling its endpoint: + ```shell curl http://localhost:8080/ping ``` -Watch for spans, metrics, and logs in the collector log output. +Watch for spans, metrics, and logs in the Collector log output. Example of the beginning of the collector log after the ping: ``` diff --git a/zipkin/README.md b/zipkin/README.md index 2a8d262bae..7206a3c68d 100644 --- a/zipkin/README.md +++ b/zipkin/README.md @@ -1,12 +1,14 @@ # Zipkin Example -This is a simple example that demonstrates how to use the OpenTelemetry SDK -to instrument a simple application using Zipkin as trace exporter. +This is a simple example that demonstrates how to use the OpenTelemetry SDK +to instrument a simple application using Zipkin as the trace exporter. -# How to run +# How to Run ## Prerequisites -* Java 1.8.231 + +* Java 17 or higher is required to run Gradle and build this example +* Java 8 or higher may be used to run the example once it has been built * Docker 19.03 ## 1 - Compile