What is Prometheus and How Does it works?

What is Prometheus?

Hey Folks,

Here is the most versatile monitoring tool available, which can monitor numerous infrastructure and application metrics. But before we begin, let's first understand what Prometheus is about:

Meaning of Prometheus:

In Greek mythology, Prometheus is a demigod (someone who is part human and part god) who stole fire from Mount Olympus and gave it to humans.

Just like Prometheus stole fire in a similar way Prometheus monitoring tool scrapes (Pull Model) the matrix from the targets and stores it in the database.

Prometheus

What is Prometheus?

Prometheus is an open-source monitoring and alerting toolkit. Since its inception in 2012 by sound cloud.

Prometheus is a free software application used for event monitoring and alerting, which helps us to record real-time metrics in a time series database (allowing for high dimensionality) built using an HTTP pull base model, with powerful and flexible queries and real-time alerting.

Uses a multi-dimensional data model with time series data identified by metrics name and key/value pairs. It makes use of PromQL, a very powerful query language, Prometheus is a pull-based metric monitoring system that needs the location of specific endpoints.

Multi-dimensional & Time-Series Database

Why do we use Prometheus?

Prometheus scrapes metrics directly from the defined endpoints or, from short-lived jobs by using a push gateway when the job exits. The scraped data are stored locally on Prometheus local storage, and rules are applied to that data to aggregate and generate new time series from existing data or generate alerts based on user-defined triggers.

In Modern, DevOps is becoming more and more complex to handle manually and therefore needs more automation typically you have multiple servers that run containerized applications and there are 100 different processes running on the infrastructure, and things are interconnected so maintaining this type of setup to run smoothly and without application down times is very challenging.

Imagine having such complex infrastructure with loads of servers distributed over many locations and you have no insight into what is happening on hardware? level or application? level like Errors? Response latency? Hardware down? Or Overloaded? may be running out of resources? etc.

Why Prometheus


In such complex infrastructure, there are more things that can go wrong when you have tons of services and applications deployed any one of them can crash and cause the failure of services, and only have so many moving pieces and suddenly application becomes unavailable to users you must quickly identify what exactly out of these hundred different things went wrong and this could be difficult and time-consuming to debugging the system manually.

How Does Prometheus work?

Prometheus collects metrics from the monitored target by scraping metrics from HTTP endpoints.

it is fundamentally different than other monitoring and alerting systems. Rather than using custom scripts that check on services and systems, the monitoring data itself is used.

Scrapping endpoint is much more efficient than other mechanisms like 3rd part agents.

            A single Prometheus server can invest up to one million samples per second as several million-time series.

Prometheus Working

Features of Prometheus:

The features of Prometheus from other metrics and monitoring systems are:

  • multi-dimensional data model with time series defined by metric name and set of key/value pairs
  • PromQL is a flexible and powerful query language to leverage this dimensionality
  • No relatives distributed storage; single server nodes are autonomous.
  • An HTTP pull-based model for time series collection
  • Pushing time series is supported via an intermediary gateway for batch/temporary jobs
  • Targets emerge via service discovery or static configuration
  • Multiple modes of graphing and dashboarding support

Features of Prometheus

Prometheus components:

  1. Rule & alert engine
  2. Query engine  
  3. Compactor
  4. Scrape engine   

Components of Prometheus

Components:

There are 4 types of metrics in Prometheus with all the data exposed we need Prometheus to grab all of this the architecture of Prometheus:

  1. Compactor: which constantly compacts the data to make it more efficient to query it.
  2. Query Engine: this allows you to query for the data to send requests to Prometheus and get some data out of it.
  3. Scrape Engine: which goes to that metrics endpoint it gets the metrics from it and puts it on the local storage.
  4. Rule & Alert Engine: most important part which allows you to aggregate some metrics data so for example if you have some query that does a lot of computation or calculation you most likely want to procure pre-calculate all of that and the rules engine permits you to do just that. An alerting engine gives you the functionality to receive alerts messages when something goes wrong

Learn about Prometheus Architecture in detail?

Prometheus Server Configuration
---

Thanks & Regards,

Kanchan Soni (https://linktr.ee/kanchansoni)

(A girl who saw the dream with an open eye to compete with self-capability in the area of IT and its Next-Gen Technology, with the ability to complete the task with perfection.)

Email: kanchansoni.cse@gmail.com




Comments

People also Look For

All about DevOps (A Complete Guide to DevOps)

How to Implement Microservice Coded In Hackathon Event

Upcoming DevOps trends

All about Cloud Computing