Get up and running with OpenTelemetry in just a few quick steps! The setup process consists of two phases--getting OpenTelemetry installed and configured, and then validating that configuration to ensure that data is being sent as expected. This guide explains how to download, install, and run OpenTelemetry in Java.
We follow OpenTelemetry java instrumentation library. We shall be exporting data in OTLP format.
Download the latest version.
This package includes the instrumentation agent as well as instrumentations for all supported libraries and all available data exporters. The package provides a completely automatic, out-of-the-box experience.
Enable the instrumentation agent using the -javaagent flag to the JVM.
If you run your Java application as a JAR file, please follow the below instruction
where <app_name> is the name you want to set for your application
You can also specify environment variables in the following way
Remember to allow incoming requests to port 4317 of machine where SigNoz backend is hosted
For Tomcat application, you need to make sure the following environment variables are set up.
If you run your
.war package by putting in
webapps folder, just add
setenv.sh in your Tomcat
This should set these environment variables and start sending telemetry data to SigNoz backend specified in the IP
app_name is the name you want to set for your application
IP of SigNoz Backend is the IP where SigNoz backend is accessible
If spans are not being reported to SigNoz, try running in debug mode by setting
The debug log level will print out the configuration information. It will also emit every span to the console, which should look something like: