Previous prometheus we made a brief introduction, describes the advantages of prometheus and contrast and other monitoring systems, today prometheus share of core components.
1, prometheus overall structure
prometheus mainly includes the following components: prometheus
server is responsible for collecting task management, log storage, and support of PromQL. Alertmanager responsible for the alarm, the flexibility to set alarm rules. pushgateway, because the role of prometheus only supports pull mode, through pushgateway ways that do not allow external access to the monitoring process, play the middle of the bridge. Web
UI, UI functionality comes Prometheus, as shown below:
Comes UI function is relatively simple, but grafana perfect support prometheus, as shown below:
2、Prometheus Server
Prometheus
Server is the core component of Prometheus, is responsible for implementing access to monitoring data storage and query. Prometheus
Server through static configuration management and monitoring goals, can also be used in conjunction with Service
Discovery of dynamically monitoring management objectives, and obtain data from these monitoring objectives. Second Prometheus
Server requires the collected monitoring data storage, Prometheus
Server itself is a timing database, the monitoring data collected in the manner of a time series which is stored in the local disk. Finally Prometheus
Foreign language PromQL Server provides a custom, to achieve the data query and analysis.
Prometheus Server built-in Express Browser UI, you can implement the query and visualize data directly through PromQL through the UI.
Federal Prometheus Server clustering capabilities can make it get data from other Prometheus Server instance, so in the case of large-scale monitoring, can be extended by the Federal Prometheus Server clustering and functional partitioning of the way.
3、Exporters
Exporter将监控数据采集的端点通过HTTP服务的形式暴露给Prometheus Server,Prometheus Server通过访问该Exporter提供的Endpoint端点,即可获取到需要采集的监控数据。
一般来说可以将Exporter分为2类:
直接采集:这一类Exporter直接内置了对Prometheus监控的支持,比如cAdvisor,Kubernetes,Etcd,Gokit等,都直接内置了用于向Prometheus暴露监控数据的端点。间接采集:间接采集,原有监控目标并不直接支持Prometheus,因此我们需要通过Prometheus提供的Client
Library编写该监控目标的监控采集程序。例如: Mysql Exporter,JMX Exporter,Consul Exporter等。
4、AlertManager
在Prometheus
Server中支持基于PromQL创建告警规则,如果满足PromQL定义的规则,则会产生一条告警,而告警的后续处理流程则由AlertManager进行管理。在AlertManager中我们可以与邮件,Slack等等内置的通知方式进行集成,也可以通过Webhook自定义告警处理方式。AlertManager即Prometheus体系中的告警处理中心。
5、PushGateway
由于Prometheus数据采集基于Pull模型进行设计,因此在网络环境的配置上必须要让Prometheus
Server能够直接与Exporter进行通信。
当这种网络需求无法直接满足时,就可以利用PushGateway来进行中转。可以通过PushGateway将内部网络的监控数据主动Push到Gateway当中。而Prometheus
Server则可以采用同样Pull的方式从PushGateway中获取到监控数据。
推荐阅读:
java设计模式之备忘录模式,世上真的有“后悔药”,带你穿越回过去
java design patterns of the intermediary model, a stone's throw double "eagle" type Erdaofanzi
java design patterns of visitor patterns, "to see people that were so, hell that stuff."
java Design Patterns bridge mode, Ultimate Strategy Mode, the world is no free lunch
java Design Patterns proxy mode, see my 72 changes
java design patterns of the build mode, Personal Tailor your creativity
java design patterns of state pattern, strategy pattern twin brother
java design patterns of iterative mode, the customer is always God
java design pattern template mode, standing on the shoulders of giants success
java Design Patterns adapter mode, real man resilient
Head First Design Patterns command mode, improve the efficiency of their duties
Head First Design Patterns decorator pattern, because participation, so agree
Head First Design Patterns Singleton pattern, each person is unique
Head First Design Patterns observer mode, you and I are publishers and subscribers
Head first design pattern strategy pattern, from life, giving back to life
More Articles:
15-year veteran testimonials alone, master is so Tempered, you read a few?
Application Monitoring Series run who monitor who develops
java mind mapping study notes, it should be a good thing to share with everyone