说到 Prometheus 不得提到监控,Prometheus能帮助我们指标数据采集、指标数据储存、指标分析与视觉化、告警等,它又可以针对系统的某些组件行监控
Promethues 架构如下
PromQL:允许进行多种操作,包括 aggregation, slicing and dicing, prediction and joins
其元件包括以下
Prometheus 支持三种类型的抓取(scraping)
在 Spring boot 中 Actuator 可以导出正在运行的应用程序的一些讯息像是健康、指标、讯息等。它使用 HTTP 端点或 JMX bean 使我们能够与其交互。我们可以如下配置
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
最後这些收集的指标我们可以透过 push gateway 方式将数据丢至 prometheus 上,在藉由 grafana 进行呈现,我们在 Spring boot 中可以引入以下两个框架实现。
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_pushgateway</artifactId>
</dependency>
最後在环境配置上我们可以如下配置,即可完成使用 prometheus 进行监控。明天将会带实验来模拟,并会针对 prometheus 配置进行一些说明
management.endpoints.web.exposure.include=prometheus # 可暴露的端点
management.metrics.export.prometheus=true
management.metrics.export.prometheus.pushgateway.base-url=${PUSHGATEWAYS_URI} # 推送 pushgateway,promethues 在 pull
management.metrics.export.prometheus.pushgateway.enabled=true
management.metrics.export.prometheus.pushgateway.push-rate=1m
management.metrics.export.prometheus.pushgateway.shutdown-operation=push
>>: [第五只羊] 迷雾森林建筑工事 IV 专案环境设定 READY GO
今天要来进行使用者点击之後跳到下一页的行为,一样延续昨天使用的介面。 所以我们选择下方的按钮(Ge...
在 App 需求中 若页面需要通过 URL 渲染远端 HTML 页面 若页面资料提供的是 html...
引言 今天会讲两题,因为第二题是我们讲过的,就当作复习吧! 第一题继续延伸进位制,第二题是已经出现...
越接近完赛越害怕自己今天到底发文了没!这几天早中晚都会反覆确认有没有发文,毕竟坚持30天写技术文章那...
本章节将要介绍如何使用 ng-content 将一个 Component 的内容投影到另一个 Com...