Hello world example of collecting promethus metrics in Node.JS using express Middleware. Also attached some more resources to learn more about prometheus exporters

What's in this Prometheus Hello World Example

In this example tutorial we have created 4 endpoints that returns response in random time:

http://localhost:3000
http://localhost:3000/one
http://localhost:3000/two
http://localhost:3000/three

Running to Checking our metrics

npm install
npm start

Now visit those endpoints couple of times so that it generates the metrics for your visits.

Metrics Endpoint

Visit metrics endpoint you will see some metrics

http://localhost:3000/metrics

Prometheus metrics example

See example_metrics.txt attached in the snippets to have an idea how prometheus metrics looks like.

Resources to learn more