What is Prometheus and what is it usually used for?

Brief and simple explanation of the purpose of the Prometheus based on my understanding

Recently I started to use Prometheus for more purposes on my project. And wanted to specify what is it usually used for and what other scenarious it is benificial to use.

So simply saying, Prometheus is a time-series database that lets you store data in two dimensions - one is time and your metric. So basically you can use it for any metric happening in time.

The most popular usage is to keep track of different metrics of instances, servers, databases, etc.

But the list, of all possible use cases, is much wider. You can track how many users were registered on your site at any point in the site's existence or how many visitors you had and how this number has changed with time. Any other similar metric like this can be stored in the Prometheus.

But Prometheus works a bit differently than other databases. It does not allow you to write data inside its storage on your own. It has its own mechanism for collecting all needed data and metrics on your own. It has plenty of embedded plugins(exporters) that lets you collect the data you need from the most popular sources, like NodeExporter, which collects metrics from your server, or MySQL exporter which pulls metrics related to your MySQL database.

So basically you need to install the needed exporter in the environment that you want to monitor. And Prometheus is going to scrape this data based on the configuration you specified(e.g., once every 5 minutes).

In cases when you cannot install an actual exporter for some reason, you can use something called Prometheus Pushgateway that allows you to create an intermediate part that is going to collect the data you need and serve these to Prometheus in a standard way.

Also, you can simply create your own plugins.

How to create a simple Prometheus exporter?

Last updated