Prometheus Concepts: Difference between revisions
Line 7: | Line 7: | ||
Prometheus will monitor targets. A target can be a server, database, virtual machine, etc. | Prometheus will monitor targets. A target can be a server, database, virtual machine, etc. | ||
=Pull vs. Push= | =Pull vs. Push= | ||
Prometheus will pull metrics, by | Prometheus will actively pull (scrap) metrics, by connecting to [[#Target|targets]]. The retrieval is done by invoking HTTP into endpoints, which are defined in the configuration. | ||
Advantages of pull vs. push: | |||
* Centralized control - the configuration is done on Prometheus and not on individual targets. | |||
* Adjustable pull rate - the system has control over pull rate, and avoids being overloaded. | |||
=Sources of Metrics= | =Sources of Metrics= | ||
==Instrumented Applications== | ==Instrumented Applications== |
Revision as of 18:03, 14 October 2020
Internal
Overview
Prometheus is a time series database plus tools to collect metrics to be stored in the database. Prometheus is a solution for system monitoring.
Target
Prometheus will monitor targets. A target can be a server, database, virtual machine, etc.
Pull vs. Push
Prometheus will actively pull (scrap) metrics, by connecting to targets. The retrieval is done by invoking HTTP into endpoints, which are defined in the configuration.
Advantages of pull vs. push:
- Centralized control - the configuration is done on Prometheus and not on individual targets.
- Adjustable pull rate - the system has control over pull rate, and avoids being overloaded.
Sources of Metrics
Instrumented Applications
Prometheus pulls metrics from instrumented applications. An instrumented application exposes Prometheus metrics on a given URL. Such an application will be identified by Prometheus as a target and scrapped at regular periods.
Exporters
An alternative are prebuilt exporters. Examples: node exporter, SQL exporter, HAProxy exporter.
Push Gateway
Push gateways are used in case of applications or short-lived jobs that do not export metrics directly.