DEV Community

Cover image for How to Monitor a Node.js App with SigNoz (Step-by-Step Guide)
Afe Damilare
Afe Damilare

Posted on

How to Monitor a Node.js App with SigNoz (Step-by-Step Guide)

🚀 WHAT YOU’LL LEARN

  • How to set up SigNoz locally with Docker

  • How to instrument your Node.js app with OpenTelemetry

  • How to view metrics and traces inside SigNoz


⚙️ PREREQUISITES

Before you begin, make sure you have:

  • Node.js installed (v14+ recommended)

  • Docker and Docker Compose installed

  • Basic familiarity with running Node.js apps


đź§± Step 1: SET UP SIGNOZ LOCALLY

SigNoz provides a quick Docker-based setup.
Open your terminal and run:

git clone https://github.com/SigNoz/signoz.git
cd signoz/deploy/docker
./install.sh

Once the setup is complete, visit:

http://localhost:3301

You should see the SigNoz dashboard running 🎉


🪄 Step 2: CREATE A SIMPLE Node.js APP

  • Let’s create a small Express app that we can monitor.

You can copy and paste the following code:

mkdir node-signoz-demo
cd node-signoz-demo
npm init -y
npm install express

  • Now, create a file called app.js:

const express = require("express");
const app = express();

app.get("/", (req, res) => {
res.send("Hello from Node.js!");
});

app.listen(3000, () => {
console.log("Server running on http://localhost:3000");
});

  • Run it with:

node app.js

Your app is now live on http://localhost:3000


📡 Step 3: ADD OpenTelemetry TO SEND DATA TO SIGNOZ

SigNoz works with OpenTelemetry, an open-source observability framework.

  • Install the necessary OpenTelemetry packages:

npm install @opentelemetry/api @opentelemetry/sdk-node @opentelemetry/auto-instrumentations-node

  • Then create a file called tracing.js with the following:

const { NodeSDK } = require("@opentelemetry/sdk-node");
const { getNodeAutoInstrumentations } = require("@opentelemetry/auto-instrumentations-node");

const sdk = new NodeSDK({
instrumentations: [getNodeAutoInstrumentations()],
});

sdk.start();

  • Finally, update your app.js to import this tracing setup:

require("./tracing"); // initialize telemetry before anything else

const express = require("express");
const app = express();

app.get("/", (req, res) => {
res.send("Hello from Node.js with SigNoz!");
});

app.listen(3000, () => {
console.log("Server running on http://localhost:3000");
});

  • Restart your app:

node app.js


📊 Step 4: VIEW YOUR METRICS AND TRACES IN SigNoz

Head back to your SigNoz dashboard (http://localhost:3301), and you should start seeing:

  • Traces from your Node.js app

  • Requests per second (RPS)

  • Latency

  • Error rates

You can explore your services, view spans, and even drill into slow requests.


âś… Step 5: ADD SOME LOAD (Optional)

You can test how SigNoz reacts to traffic by sending requests to your app:

for i in {1..50}; do curl http://localhost:3000; done

Now, refresh your SigNoz dashboard — you’ll see data populating in real-time.


🎯 Conclusion

Congrats! You’ve successfully:

  • Set up SigNoz using Docker

  • Created a simple Node.js application

  • Added OpenTelemetry instrumentation

  • Viewed live metrics and traces inside SigNoz

Monitoring your app is an essential step to improving reliability and performance.
With SigNoz, you get powerful observability tools for free and open-source.


đź§© Next Steps

  • Try monitoring a real API or microservice

  • Explore SigNoz alerting and dashboards

  • Read more: https://signoz.io/docs/


âś… If you enjoyed this tutorial, share it or comment below

Top comments (0)