Skip to main content

Monitor your Spring Boot application with OpenTelemetry and SigNoz

ยท 6 min read
Ankit Anand

OpenTelemetry can auto-instrument your Spring Boot application to capture telemetry data from a number of popular libraries and frameworks. Let's learn how it works.

Cover Image

OpenTelemetry is a vendor-agnostic instrumentation library. In this article, let's explore how you can auto-instrument your Java Spring Boot application with OpenTelemetry and get the data reported through SigNoz - an open-source APM and observability tool.

Steps to get started with OpenTelemetry for Spring Boot application:

  • Installing SigNoz
  • Installing sample Spring Boot app
  • Auto instrumentation with OpenTelemetry and sending data to SigNoz

Installing SigNozโ€‹

You can get started with SigNoz using just three commands at your terminal.

git clone
cd signoz/deploy/

For detailed instructions, you can visit our documentation.

Deployment Docs

When you are done installing SigNoz, you can access the UI at: http://localhost:3000

The application list shown in the dashboard is from a sample app called HOT R.O.D that comes bundled with the SigNoz installation package.

SigNoz dashboard showing application list
SigNoz Dashboard

Installing sample Spring Boot appโ€‹

If you don't have Java installed, first install it from the official website.

For this tutorial, we will use a sample Spring Boot application built using Maven. You can find the code for the application at its GitHub repo.

Steps to get the app set up and running:

  1. Git clone the repository and go to the root folder

    git clone
    cd spring-petclinic
  1. Run the application using the following commands.

    ./mvnw package
    java -jar target/*.jar

    You can now access the application UI here: http://localhost:8090/

Spring PetClinic app accessed at port:8090
Sample Spring Boot application running in your local host.

Once you ensure that your application runs fine, stop it with ctrl + c on mac, as we will be launching the application with the Java agent downloaded from OpenTelemetry.

Auto instrumentation with OpenTelemetry and sending data to SigNozโ€‹

For instrumenting Java applications, OpenTelemetry has a very handy Java JAR agent that can be attached to any Java 8+ application. The JAR agent can detect a number of popular libraries and frameworks and instrument it right out of the box. You don't need to add any code for that.

  1. Download the latest Java JAR agent. You will need the path of this file, so note it down somewhere. You can also use the terminal to get this file using the following command:

  2. Now you need to enable the instrumentation agent as well as run your sample application. You can do so by the following command:

    OTEL_METRICS_EXPORTER=none OTEL_EXPORTER_OTLP_ENDPOINT="http://<IP of SigNoz>:4317" java -javaagent:/path/opentelemetry-javaagent.jar -jar target/*.jar

    As you are running this on your local host, you need to replace `IP of SigNoz` with `localhost`. You will also need to update the path for your downloaded Java JAR agent. You will replace following two things:
    • IP of SigNoz : localhost
    • /path/to : Users/cruxaki/Downloads (For my local)

    Your final command will look like this:

    OTEL_METRICS_EXPORTER=none OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:4317" java -javaagent:/Users/cruxaki/Downloads/opentelemetry-javaagent.jar -jar target/*.jar

    Note the path is updated for my local environment. If you are using a virtual machine, you need to update the IP accordingly. You also need to have the Java JAR agent on the same machine.

    You can also use -D option to install the java agent.

    java -javaagent:/path/opentelemetry-javaagent.jar \
    -Dotel.metrics.exporter=none \
    -Dotel.exporter.otlp.endpoint=http://<IP of SigNoz>:4317 \
    -Dotel.resource.attributes="<service_name>" \
    -jar target/*.jar

Check out the Spring Pet Clinic app at: http://localhost:8090/ and play around with it to generate some load. You can try refreshing the endpoint multiple times to generate load. It might take 1-2 minutes before it starts showing up in the SigNoz dashboard.

Below you can find your javaApp in the list of applications being monitored.

`Javaapp` appears in the list of applications monitored through SigNoz
`javaApp` in the list of applications monitored

Metrics and Traces of the Spring Boot applicationโ€‹

SigNoz makes it easy to visualize metrics and traces captured through OpenTelemetry instrumentation.

SigNoz comes with out of box RED metrics charts and visualization. RED metrics stands for:

  • Rate of requests
  • Error rate of requests
  • Duration taken by requests
    SigNoz dashboard showing application latency, requests per sec, error percentage and top endpoints
    Measure things like application latency, requests per sec, error percentage and see your top endpoints with SigNoz.

You can then choose a particular timestamp where latency is high to drill down to traces around that timestamp.

List of traces shown on SigNoz dashboard
View of traces at a particular timestamp

You can use flamegraphs to exactly identify the issue causing the latency.

Flamegraphs and gantt charts to visualize time taken by requests
Flamegraphs showing exact duration taken by each spans - a concept of distributed tracing

You can also build custom metrics dashboard for your infrastructure.

SigNoz custom metrics dashboard
You can also build a custom metrics dashboard for your infrastructure


OpenTelemetry makes it very convenient to instrument your Spring Boot application. You can then use an open-source APM tool like SigNoz to analyze the performance of your app. As SigNoz offers a full-stack observability tool, you don't have to use multiple tools for your monitoring needs.

You can try out SigNoz by visiting its GitHub repo ๐Ÿ‘‡

SigNoz repo

If you are someone who understands more from video, then you can watch the tutorial on how to use OpenTelemetry for Spring Boot application here ๐Ÿ‘‡

If you have any questions or need any help in setting things up, join our slack community and ping us in #help channel.

SigNoz Slack community

If you want to read more about SigNoz ๐Ÿ‘‡

Golang Aplication Monitoring with OpenTelemetry and SigNoz

Nodejs Application Monitoring with OpenTelemetry and SigNoz