Skip to main content

Monitor your Go application with OpenTelemetry and SigNoz

· 5 min read
Ankit Anand

OpenTelemetry provides a set of APIs to directly measure the performance and behavior of your software and send this data to observability platforms. Let's learn how to get started with OpenTelemetry for Go applications and visualize that data with SigNoz.

Monitor your Go applications with SigNoz

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

Steps to get started with OpenTelemetry for Go application

  • Installing SigNoz
  • Installing sample Go application
  • 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
SigNoz dashboard

Installing sample Go application

To see how OpenTelemetry can be used to instrument a Go application, let's see how it works with a sample bookstore app (GitHub repo).

It is a simple bookstore app with a REST API that provides book data and performs CRUD operations. The app uses Gin framework to build a RESTful API. Gin is a high-performance HTTP web framework written in Golang containing a set of commonly used functionalities like routing, middleware support and rendering.

OpenTelemetry has specific instrumentation packages to support popular Go packages and use cases.  For example, this app uses the Gin framework for request routing. OpenTelemetry provides instrumentation package named otelgin to instrument the Gin framework which you need to import in your app. You can find the complete list of supported Golang packages here.

Prerequisites Verify if you have Golang installed on your machine by running $ go version on your terminal. If you don't have Golang installed, you can download it here.

Steps to install sample Go application:

  1. Clone sample Go application repository
    From your terminal use the following command to clone sample Go application GitHub repository.

    git clone
  2. Update path to sample-golang-app
    Update your terminal path to the sample app directory

    cd sample-golang-app

Instrumentation with OpenTelemetry and sending data to SigNoz

The file main.go has instructions to import all the necessary OpenTelemetry packages in order to instrument the sample app. For this app, we import the following OpenTelemetry packages.

import (

sdktrace ""

You need to run the Go app with the necessary environment variables in order to start sending data to SigNoz. Use the following command to run and configure the app to send data to SigNoz:

Ip of SigNoz can be replaced with localhost in this case. Hence, the final command becomes:


And, congratulations! You have instrumented your sample Golang app.

Hit the /books endpoint of the bookstore app at http://localhost:8090/books. Refresh it a bunch of times in order to generate load, and wait for 1-2 mins for data to appear on SigNoz dashboard.

Sample Go app
/books endpoint of our bookstore app

You can now access the SigNoz dashboard at http://localhost:3000 to monitor your app for performance metrics.

Sample Go app in the list of applications monitored by SigNoz
Sample Golang app appears in the list of application

If you want to instrument your own Golang application, you can read about it in our documentation.

Metrics and Traces of the Go 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 charts and visualization
Measure things like application latency, requests per sec, error percentage and see your top endpoints

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

See traces, and apply powerful filters on trace data
View of traces at a particular timestamp

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

Flamegraphs for distributed tracing
Flamegraphs showing exact duration taken by each spans - a concept of distributed tracing


OpenTelemetry makes it very convenient to instrument your Go applications and generate telemetry data. 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 GitHub repo

If you face any issues while trying out SigNoz, feel free to write to us at: [email protected]

If you want to read more about SigNoz 👇
Monitor your Spring Boot application with OpenTelemetry and SigNoz