域名备案成功如何做网站app界面设计教程
web/
2025/10/5 2:47:00/
文章来源:
域名备案成功如何做网站,app界面设计教程,c2c模式有哪些,杭州市建设工程信用网名词解释
Promethus 是什么
开源的【系统监控和警报】工具包
专注于#xff1a; 1#xff09;可靠的实时监控 2#xff09;收集时间序列数据 3#xff09;提供强大的查询语言#xff08;PromQL#xff09;#xff0c;用于分析这些数据
功能#xff1a; 1#xff0…名词解释
Promethus 是什么
开源的【系统监控和警报】工具包
专注于 1可靠的实时监控 2收集时间序列数据 3提供强大的查询语言PromQL用于分析这些数据
功能 1【监控】各种资源、服务和应用程序的性能指标 2支持多维数据模型和灵活的查询语言从而 - 用户可以轻松地获取他们关心的信息
Actuator 是什么 监控 SpringBoot 应用程序 在Java生态系统中Spring Boot 提供了 Actuator 模块用于【监控和管理】应用程序
举例
1监控应用程序健康状况 Actuator 提供了 /actuator/health 端点用于检查应用程序的健康状态。通过这个端点你可以了解应用程序是否运行正常、数据库连接是否正常等。
2查看应用程序信息 使用 /actuator/info 端点可以查看应用程序的自定义信息比如构建版本、作者、描述等。
3监控应用程序性能 Actuator 提供了 /actuator/metrics 端点用于查看应用程序的各种性能指标比如内存使用情况、线程池状态、垃圾回收等
4查看运行时环境 使用 /actuator/env 端点可以查看应用程序的环境属性包括配置属性、系统属性等。
5查看配置信息 通过 /actuator/configprops 和 /actuator/beans 端点可以查看应用程序的配置信息和所有注册的 Spring beans。
Promethus 和 Actuator 的关系是什么 一句话Actuator 为 Promethus 提供数据 Prometheus 和 Spring Boot Actuator 是两个不同的工具但它们可以结合使用以提供更全面的监控和管理解决方案。
Spring Boot Actuator 提供了一些默认的监控端点包括 /actuator/prometheus 端点该端点可以为 Prometheus 提供可以抓取的指标数据
通过配置 Prometheus来定期从这个端点获取数据你可以将 Spring Boot 应用程序的监控数据整合到 Prometheus 中从而实现集中的监控和数据分析
这种结合使用的方式使得开发人员和运维团队可以在 Prometheus 中集成 Spring Boot 应用程序的监控数据并在 Grafana 等可视化工具中创建仪表盘以更好地了解应用程序的性能和运行状况。
AlertManager 是什么 报警用的 AlertManager 是由Prometheus社区开发的一个组件 用于处理Prometheus 监控系统 生成的警报。它能够管理和路由警报发送通知以及对警报进行抑制和静音
a是什么
用于【可视化和分析时序数据】的开源平台 它支持多种数据源包括 Graphite、Prometheus、Elasticsearch、InfluxDB 等
Promethus 基本概念
官网地址
Promethus 工作方式收集、存储 metrics指标并将其存储为time series data时间序列数据 收集 metrics指标的方式【抓取(scrape)】目标的 metrics HTTP endpoints time series: 随时间变化的记录 Metrics : 在理解应用程序为什么以某种方式运行、方面发挥着重要作用 由于 Prometheus 以同样的方式公开其自身的数据因此它还可以抓取和监控其自身的健康状况
虽然单纯收集 Promethus 自身的数据没什么用但是它却是一个很好的快速上手的例子
prometheus.yml 配置文件如下
global:scrape_interval: 15s # By default, scrape targets every 15 seconds.# 当与外部系统通信时将这些标签附加到所有【time series(时间序列)】或【alert(警报)】上# Attach these labels to any time series or alerts when communicating with# external systems (federation, remote storage, Alertmanager).external_labels:monitor: codelab-monitor# 一个抓取配置在这里仅包含一个要抓取的端点就是 Prometheus 自身
# A scrape configuration containing exactly one endpoint to scrape:
# Here its Prometheus itself.
scrape_configs:# The job name is added as a label jobjob_name to any timeseries scraped from this config.- job_name: prometheus# 覆盖全局的第二行的那个scrape_interval# Override the global default and scrape targets from this job every 5 seconds.scrape_interval: 5sstatic_configs:- targets: [localhost:9090]查看抓取的端点
http://localhost:9090/targets 蓝色代表成功抓取 Prometheus 自身的数据
Prometheus 自带浏览器
让我们看一下Promethus 抓到的它自己的数据
访问下面地址来使用 Prometheus 自带的浏览器地址 http://localhost:9090/graph
另外从 http://localhost:9090/metrics 中可以看到Prometheus 所暴露的自身的指标
prometheus_target_interval_length_seconds目标抓取时间间隔 Expression browser
expression browser位于 Prometheus 服务器上的 /graph 中允许您输入任何表达式并以表格形式或随时间变化的图表形式查看其结果
这主要用于【临时查询和调试】
对于图表请使用 Grafana 或控制台模板
如下和上边一致 配置规则将抓取的数据聚合到新的时间序列中
对聚合了上千条数据的【时间序列】进行查询会导致缓慢
为了提高效率Prometheus 通过配置 recording rules.将 表达式提前记录到新的、持久化的时间序列中
一个例子 假设我对所记录的每个实例上的【per-second rate of cpu time (node_cpu_seconds_total) cpu 使用率】感兴趣但要保留 job, instance, mode 维度并对其进行测量5 分钟的时间窗口为维度
我们可以使用
avg by (job, instance, mode) (rate(node_cpu_seconds_total[5m]))对应 prometheus.rules.yml 文件
groups:
- name: cpu-noderules:- record: job_instance_mode:node_cpu_seconds:avg_rate5mexpr: avg by (job, instance, mode) (rate(node_cpu_seconds_total[5m]))同时 prometheus.yml. 中新增
rule_files:- prometheus.rules.yml让 Grafana 支持 Prometheus 最终效果
alerting 概述
ALERTING OVERVIEW
Prometheus 中的 Alerting(报警) 分为两部分 1Prometheus servers 中的 Alerting rules 将 alerts 发送给 Alertmanager 2之后Alertmanager 管理这些 alerts
alerts 包括silencing, inhibition, aggregation 以及通过 email, on-call notification systems呼叫通知系统和聊天平台等方式发送通知
设置 alerting 和 notifications 的主要步骤是
设置和配置 Alertmanager配置 Prometheus 与 Alertmanager 对话在 Prometheus 中创建警报规则
ALERTMANAGER
Alertmanager 用于处理 客户端应用如 Prometheus Server发出的 alerts 负责deduplicating, grouping, and routing them to the correct receiver integration such as email, PagerDuty, or OpsGenie. 同样还负责silencing and inhibition of alerts
下面介绍 Alertmanager 所实现的核心概念。 请参阅配置文档以了解如何更详细地使用它们。
Grouping
Grouping 将相似性质的 alerts 分类到 a single notification. 非常实用的场景大规模停机同时出发成百上千个警告
Inhibition
Inhibition如果某些其他警报已经触发则抑制某些警报的通知
举例如果特定警报正在触发Alertmanager 可以配置与此集群相关的、所有其他警报静音 好处防止无关警报出发
Silences
在给定时间内简单地静音警报 基于 matchers 进行配置 检查 alert 是否与 等式 或 正则 匹配是则不会发出警报 在 Alertmanager Web 界面配置
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/web/87110.shtml
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!