prometheus basics

prometheus overview

  • Language: go, high performance and concurrency
  • Monitoring mode: pull mode, the client is only responsible for collecting data, simplifying complexity
  • Interface: HTTP, simple and convenient
  • Database: time series database
  • Alarm: Support

The advantage of the Pull method is that it can automatically perform upstream monitoring and horizontal monitoring, with fewer configurations, easier to expand, more flexible, and easier to achieve high availability, which is different from the Push method.

Time series database and relational database

Time series database

  • Write operation:
    • Time is a main axis, and data usually arrives in chronological order
    • Most measurements are written within a few seconds or minutes after observation, and arriving data is almost always recorded as new entries
    • Basically 95% to 99% of operations are writes
  • Read operation:
    • Almost no single measurement read and delete operations at random locations
    • Reading and deleting are batches, starting from a certain time within a period of time
    • The data read may be very large
  • Save operation:
    • The data structure is simple, and the value decreases rapidly over time
    • Reduce storage costs by compressing, moving, deleting, etc.

Most of them are write operations, which are not so important to the data itself. They are generally reserved for a short period of time, support storage compression, and save storage resources

Relational Database

  • Write operations: most operations are DML operations, insert, update, delete, etc.
  • Read operation: read logic is generally more complicated
  • Storage operation: rarely compress, generally do not set data life cycle management

Basic operations are available, the query logic is complex, and the data requirements are high

For the monitoring system, it can be divided into 2 types

  • Traditional industry: it is aimed at the server itself, through the IP carrier
  • Cloud computing: the carrier becomes a service, an object

Scenarios that cannot be achieved by traditional industry monitoring

  • Data collection and monitoring of cloud computing services other than the host
  • Continuous data collection and monitoring of cross-host objects such as container orchestration
  • Data collection and monitoring of Paas or Saas services
  • Data collection and monitoring of business systems and IOT

Prometheus is service-oriented monitoring, and traditional tools such as zabbix are ip-oriented monitoring

prometheus component

  • Prometheus server (server side): Prometheus's main server, used to collect and store time series data
  • AlertManage (server-side) r: alert processing, support creation of alert rules based on PromQL, if the rules defined by PromQL are met, an alert will be generated, and the follow-up process of alert processing will be managed by AlertManager
  • Exporters (client): Expose service indicators (compare services to distinguish whether they are supported or not)
    • Service support: This type of Exporter directly has built-in support for Prometheus monitoring, such as cAdvisor, Kubernetes, Etcd, Gokit, etc., all have directly built-in endpoints for exposing monitoring data to Prometheus
    • Service not supported: The original monitoring target does not directly support Prometheus, so we need to write the monitoring collection program of the monitoring target through the Client Library provided by Prometheus. For example: Mysql Exporter, JMX Exporter, Consul Exporter, etc.
  • PushGateway: When the server and the client cannot communicate directly, you can use PushGateway to transfer
    Insert picture description here

Guess you like

Origin blog.csdn.net/yangshihuz/article/details/113698073