Metrics Collection using Prometheus

Metrics Collection using Prometheus

In production systems, issues can happen at various levels. Based on metrics collection over a period of time, a good alerting/monitoring…

In production systems, issues can happen at various levels. Based on metrics collection over a period of time, a good alerting/monitoring solution can help to avoid some of the issues or can help to take action before the issue affects users. Prometheus is one such solution that can be used independently for metrics collection and alerts or in conjunction with something like Grafana for better dashboards and alerts. Prometheus is a CNCF graduated project, so it has wide enterprise adoption and community support.

Prometheus mainly is a pull-based system that scrapes/collects from source systems/applications on set schedules. This part is taken care of by the scheduler component. Then metrics are stored in a time series database and exposed using API. Prometheus does have UI to run queries using its PromQL language. We can set alerts in Prometheus. Prometheus can get these metrics from windows and Linux servers using exporters or from defined metrics endpoints where applications publish their metrics to.

Image for post

Scheduler scrapes metrics from servers, and applications

For batch processes, a push gateway can be used.


Linux servers, windows servers, Kubernetes already collect a lot of metrics by default. By using exporters they can make those metrics available at standard endpoint like /metrics in Prometheus format. Prometheus can then collect these metrics at set schedules. These are in Key/value format but keys can have labels. For example, for Memory Available, it can be at just node level but for disk_io, it can be per disk by using label per disk.

node-exporter prometheus

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Node JS Development Company | Hire Node.js Developers

Looking to hire Node js developers? One of the top Node js development companies in India & USA offers cost-effective Node js web development services.

Node.js Tips —MongoDB Connections, Fetch, and Exports

Sharing MongoDB connections, multiple MongoDB connections, and more tips.

How To Import and Export Modules in Node.js Tutorial

In this tutorial, you'll learn how to import modules in Node.js and also export modules in Node.js. — Follow Me — Twitter: F

Node.js Application Monitoring with Prometheus and Grafana

We get to know Prometheus and Grafana and learn how to use them to monitor Node.js applications. Application monitoring is essential for every production software system.

Getting started with modules in Node.js: module.exports and exports

In this Node.js tutorila, you'll learn how to work with modules in Node.js, explaining the difference between module.exports and exports and focusing on how to export and consume them.