(1) Overview (concept, components, architecture, applicable scenarios) | Prometheus (Prometheus)

What is Prometheus?

Prometheus is an open source system monitoring and alerting toolkit originally built at  SoundCloud . Since its inception in 2012, many companies and organizations have adopted Prometheus, and the project has a very active developer and user community . It is now an independent open source project, maintained independently of any company. To emphasize this point and clarify the project's governance structure, Prometheus joined the Cloud Native Computing Foundation in 2016  , becoming the second hosted project after Kubernetes .

Prometheus collects and stores its metrics as time series data, i.e. metric information is stored with a timestamp when it was recorded and optional key-value pairs called labels.

For a more detailed overview of Prometheus, see  the resources linked in the media section.

feature

The main features of Prometheus are:

  • A multidimensional data model with time-series data identified by measure names and key/value pairs
  • PromQL, a flexible query language that exploits this dimensionality
  • Does not rely on distributed storage; individual server nodes are autonomous
  • Time series collection is via a pull model over HTTP
  • Support for pushing time series through intermediate gateways
  • Discover targets through service discovery or static configuration
  • Multiple graphics modes and dashboard support

What are metrics?

In layman's terms, metrics are numerical measurements, and time series means recording changes over time. What the user wants to measure varies from application to application. For a web server it might be the request time, for a database it might be the number of active connections or active queries etc.

Metrics play an important role in understanding why your application works a certain way. Suppose you are running a web application and find that the application is slow. You will need some information to understand what is going on with your application. For example, the application may slow down when the number of requests is high. If you have request count metrics, you can figure out why and increase the number of servers to handle the load.

components

The Prometheus ecosystem consists of several components, many of which are optional:

Most Prometheus components are written in Go , which makes them easy to build and deploy as static binaries.

architecture

This diagram illustrates the architecture of Prometheus and some of its ecosystem components:

Prometheus grabs the indicators directly from the detection job, or grabs the indicators from  the short-lived jobIt stores all scraped samples locally and runs rules on this data to aggregate and record new time series or generate alerts from existing data. Grafana or other API users can display the collected data graphically.

What scenarios apply?

Prometheus can log any purely numeric time series just fine. It is suitable both for machine-centric monitoring and for monitoring highly dynamic service-oriented architectures. In the world of microservices, its support for multidimensional data collection and query is a special advantage.

Designed for reliability, Prometheus is the system you can use during an outage, allowing you to quickly diagnose problems. Each Prometheus server is self-contained and does not depend on network storage or other remote services. You can rely on it when other parts of your infrastructure break, and you don't need to set up a lot of infrastructure to use it.

What scenarios are not applicable?

Prometheus takes reliability seriously. You can view available statistics about your system at any time, even in failure situations. If you need 100% accuracy, such as billing per request, Prometheus is not a good choice, because the collected data may not be detailed and complete enough. In this case, you're better off using another system to collect and analyze data for billing purposes, and Prometheus for the rest of the monitoring.

Guess you like

Origin blog.csdn.net/u011936655/article/details/124047827