1 view
How does Prometheus work once it has started?
Asked at
AI answer
After startup, Prometheus loads its configuration and rules, opens its local TSDB, and starts operating as a monitoring server:
- Discovers targets for metric collection — using static configuration or service discovery. It applies relabeling to filter targets and configure their parameters.
- Collects metrics using the pull method — it periodically contacts targets’ HTTP endpoints, usually
/metrics, and parses the returned data. Pushgateway is sometimes used for systems that cannot expose metrics directly. - Stores time series — new values are written to the in-memory portion of the TSDB and the WAL; the data is then compacted into blocks on disk. The retention policy determines how long data is kept.
- Evaluates rules — it runs recording rules and alerting rules on a schedule. It sends firing alerts to Alertmanager, which handles grouping, routing, and notifications.
- Serves queries — PromQL queries arrive through the HTTP API or UI and are executed against the stored data.
If a target is unavailable, Prometheus does not receive a sample from it during that cycle and usually sets its up metric to 0.
Also asked at RWB
- Why did you decide to change jobs / leave your current company?
- What is the key difference between TCP and UDP?
- What is the difference between git merge and git rebase? When should each approach be used?
- What is an inode in Linux?
- Which command is used to determine the route of a packet from your device to the target host?
Similar questions
- How does an exporter work in Prometheus monitoring? What role does it play, and where does it get its metrics?
- How do you monitor Prometheus's own internal state (for example, series deletion or WAL corruption)?
- What is the core idea behind Prometheus’s pull model? What are its advantages and disadvantages?
- What have you done with Grafana and Prometheus?
- How does Prometheus’s model differ from Zabbix’s model (push and pull models)?