Introduction to Prometheus:

Prometheus:

Prometheus is an open-source systems monitoring and alerting toolkit.

Time Series database:

designed to store and retrieve data records that are part of a “time series,”

Time series is a set of data points that are associated with timestamps which provide a critical context for each of the data points in how they are related to others.

Prometheus is good for time series metrix:

sophisticated local storage subsystem. For indexes, it uses Level DB

for bulk data it has own custom storage layers, which organizes sample data in chunks of constant size.

Components of Prometheus:

  • Prometheus server :which scrapes and stores time series data
  • Client libraries::for instrumenting application code
  • Push gateway :for supporting short-lived jobs
  • Exporters::for services like HAProxy, StatsD, Graphite, etc.
  • Alert manager: to handle alerts
  • various support tools

Most Prometheus components are written in Go, making them easy to build and deploy as static binaries.

Prometheus working:

Prometheus scrapes metrics from instrumented jobs, either directly or via an intermediary push gateway for short-lived jobs. It stores all scraped samples locally and runs rules over this data to either aggregate and record new time series from existing data or generate alerts.

It scrapes metrics by any of the following ways:

  • By instrumenting
  • By using the prebuilt exporters
  • By using the Pathgateway