Day 79 of #90DaysOfDevOps

Prometheus

  • It's an open-source system for monitoring services and alerts based on a time series data model. Prometheus collects data and metrics from different services and stores them according to a unique identifier—the metric name—and a time stamp.

Tasks:

  1. What is the Architecture of Prometheus Monitoring?

    • Prometheus is an open-source monitoring and alerting system that uses a pull-based model. Prometheus' architecture includes several key components that work together to collect, store, and process metrics data:

      • Pull-based system: Prometheus collects data from the services it monitors, rather than having the services push the data to Prometheus. This makes it easy to set up and configure.

      • Service discovery: A fundamental feature that automates the process of identifying and monitoring targets dynamically. Prometheus can perform service discovery using DNS entries.

      • PromQL: A simple and expressive query language to retrieve and manipulate data. It allows users to easily query and aggregate data based on various criteria.

      • Multi-dimensional data model: Prometheus uses a multi-dimensional data model with time series data and metrics in the form of key-value pairs.

      • Autonomous single server nodes: Prometheus uses autonomous single server nodes.

      • Data storage: Prometheus has robust data storage.

      • Alerting capabilities: Prometheus has alerting capabilities.

      • Exporters: Prometheus has an extensive ecosystem of exporters.

      • Integration with Grafana: Prometheus integrates with Grafana.

  2. What are the Features of Prometheus?

    • Prometheus has many features, including:

      • Data model

        Prometheus uses a multi-dimensional data model that identifies time series data by metric name and key/value pairs.

      • PromQL

        Prometheus uses PromQL, or Prometheus Query Language, to query and aggregate time series data. PromQL is a flexible query language that supports functions like arithmetic, logic, comparison, aggregation, and grouping.

      • No distributed storage

        Prometheus doesn't rely on distributed storage, and its single server nodes are autonomous.

      • Visualization

        Prometheus has multiple modes for visualizing data, including a built-in expression browser, Grafana integration, and a console template language. Grafana is a common external integration for Prometheus visualization.

      • Service discovery

        Prometheus uses service discovery to find targets for scraping.

      • Labels and annotations

        Prometheus includes labels, annotations, and a mechanism for tracking status and changes for various elements.

  3. What are the Components of Prometheus?

    • Prometheus is a monitoring tool that has many components, including:

      • Server

        The core component of Prometheus, the server retrieves, stores, and queries monitoring data. It collects metrics from configured targets at given intervals, evaluates rule expressions, displays the results, and can trigger alerts if some condition is observed to be true.

      • Alert Manager

        One of the main components in Prometheus ecosystem. It analyzes, visualizes, and sends alerts to respective members or team.

      • Service discovery

        One of the major features of Prometheus. It helps keep the infrastructure up to date.

      • PromQL

        A flexible querying language that can leverage the multi-dimensional data model. It allows for powerful analysis and processing of time series.

      • Storage

        Prometheus supports two storage architectures:

        • Local disk storage: Data are compressed and stored on local disk.

        • Remote storage: Prometheus supports third-party storage (e.g. Kafka, PostgreSQL, Amazon S3) via ProtoBuffer adaptor.

      • Other components of Prometheus include: Prometheus Kubernetes, Scaling Prometheus, Helm.

  4. What database is used by Prometheus?

    • Prometheus is an open-source monitoring system and time series database. Prometheus uses LevelDB for indexes and its own custom storage layer for bulk sample data.
  5. What is the default data retention period in Prometheus?

    • The default data retention period in Prometheus is 15 days. You can adjust this by configuring the storage retention time.