Chapter 2 Introduction to Prometheus

The origin of the Prometheus

Facebook found that 85% of queries were for data within 26 hours. This requires a strong query language and often limited retention periods for monitoring data.

architecture

The metrics collected

Using a pull mode, you need to install your exporter to export metrics to a specific port.

  • Endpoint: The source of metris

  • Target configuration: How do you connect, what metadata is applied, what authentication is required for the connection, or define how fetching will be performed

  • Job: A set of targets

Service discovery

  • Based on the file
  • Automatically discover

Aggregation and alerts

Query data

Query promQL, graphical interface

The data model

Each time series is uniquely identified by a combination of time series names and labels

  • Instrumentation label: add before fetching
  • Target label: added after fetching

Metrics starting with _ is for internal use

The name of the metrics

Consists of ASCII characters, digits, underscores (_), and colons ()

The sampling

  • A value of type float64
  • A millisecond precision timestamp

Define the rules

metrics_name{label1=value1, label2=value2}

Retention time

It keeps 15 days of time series data in its database.

security

  • Untrusted users will be able to access the HTTP API of the Prometheus server to access all data in the database. Confused. JPG
  • Only trusted users have access to the Prometheus command line, configuration files, rules files, and runtime configurations.

Prometheus and its components do not provide any server-side authentication, authorization, or encryption