Skip to content

Getting Started with OpenTelemetry Java

Test Java Snippets Minimum Java Version

Snippets that will guide you through instrumenting Java applications with OpenTelemetry Java SDK. You'll learn how to implement both manual and automatic instrumentation to emit traces, metrics, and logs to console/OTLP backends.

OpenTelemetry Java in a nutshell

Prerequisites

Before starting with this tutorial, ensure you have the following tools installed on your system:

  • Java - Java Development Kit (JDK 17 or later)
  • Install via package manager: brew install openjdk (macOS) or apt install openjdk-17-jdk (Ubuntu)

  • Gradle - Build automation tool (optional, as projects include Gradle wrapper)

  • Download from gradle.org
  • Or install via package manager: brew install gradle (macOS)

  • Docker - For running OpenTelemetry Collector and observability backends

  • Download from docker.com

List of snippets

Following is a list of all available OpenTelemetry Java snippets:

basics


Congratulations! You now have a solid foundation for instrumenting Java applications with OpenTelemetry. Start with the simple examples and gradually add more sophisticated instrumentation as your observability needs grow.