Sobes.tech
Middle

What is Prometheus?

sobes.tech AI

Answer from AI

Prometheus is an open-source monitoring and alerting system.

Main concepts:

  • Data model: Time series, where each series is identified by a metric and a set of key-value pairs (labels).
  • Collection mechanism: "Pull" model over HTTP. Prometheus itself pulls metrics from target objects (exporters).
  • Query language: PromQL for creating complex queries, building graphs, and generating alerts.
  • Storage: Local disk storage with compression. Supports integration with remote storage.
  • Service discovery: Dynamic discovery of targets for monitoring.
  • Alerts: Alertmanager handles alerts sent by Prometheus and routes them to various notification systems.

Applications:

  • Infrastructure monitoring (servers, networks)
  • Application and service monitoring (Go, Java, Node.js, etc.)
  • Creating custom metrics
  • Visualizing monitoring data (usually with Grafana)

Key components:

  • Prometheus Server: The main server that collects and stores metrics.
  • Exporters: Programs that provide metrics in Prometheus format (e.g., node_exporter for OS monitoring).
  • Pushgateway: An intermediate service for collecting metrics from short-lived processes.
  • Alertmanager: Handles and sends alerts.

Example PromQL query:

# Average number of requests per second over the last 5 minutes
rate(http_requests_total[5m])