
prometheus
文章平均质量分 64
咸鱼还是要有梦想的
这个作者很懒,什么都没留下…
展开
-
prometheus自身指标
go_gc_duration_seconds 垃圾回收周期暂停时长go_memstats_alloc_bytes 已分配且仍在使用的字节数go_memstats_alloc_bytes_total 分配的总字节数,即使已释放go_memstats_buck_hash_sys_bytes 分析桶哈希表使用的字节数go_memstats_frees_total 空闲内存go_memstats_gc_cpu_fraction 自程序启动以来,GC 使用的该程序可用 C...原创 2021-08-27 17:26:58 · 2205 阅读 · 0 评论 -
Prometheus rate和irate查询实现
rate该函数用来计算某个指标在最近一个区间时间内的变化率。比如说,Prometheus每15秒采集一次数据,当某个指标metric1的数据采集如下:timestamp value 15:00:00 10000 15:00:15 10030 15:00:30 10045 15:00:45 10090 假设当前时间为15:00:50,我们执行PromQL语句rate(metric1[1m]),该语句的返回值为2,计算过程如下:Prometheu原创 2021-08-23 19:10:36 · 2354 阅读 · 0 评论 -
prometheus 查询30d数据出现query processing would load too many samples问题
问题现象:prometheus查询长时间段的数据时出现query processing would load too many samples的问题,导致数据查询不出来。问题原因:prometheus为了对自身进程进行保护,进行了限制,默认为50000000.可以通过--query.max-samples参数进行调整。解决方式:1.根据实际内存,对query.max-samples参数进行调整,谨慎操作。2.进行record rule规则的配置。在此对record rule规则配置进原创 2021-08-21 16:47:49 · 2176 阅读 · 0 评论 -
Prometheus 四种指标类型
prometheus 包含四种核心的指标类型:Countercounter 是一个累积计数的指标,仅支持增加或者重置为0(只增不减 )。例如:可以用来统计服务请求的数量,任务完成数量,或者出错的数量。Java的使用如下:import io.prometheus.client.Counter;class YourClass { static final Counter requests = Counter.build() .name("requests_total").hel原创 2021-01-12 19:51:46 · 5418 阅读 · 0 评论 -
Prometheus 告警配置以及抑制规则inhibit_rules 说明
1.在prometheus.yml配置文件中进行告警规则文件的配置:global:# Rule files specifies a list of globs. Rules and alerts are read from# all matching files.rule_files: [ - <filepath_glob> ... ]例如: - rules/br_alerts.yml rules为相对路径2.在告警的规则文件中进行具体的告警规则配置## Ale原创 2021-01-12 17:53:59 · 7033 阅读 · 0 评论 -
Prometheus配置详解
prometheus配置文件说明 ,官网地址:https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config全局整体分为六个部分,具体配置如下:global: # How frequently to scrape targets by default. [ scrape_interval: <duration> | default = 1m ] # How ..原创 2020-12-07 11:04:04 · 1591 阅读 · 0 评论 -
Prometheus 重新加载配置
在生产环境中,prometheus经常会存在修改配置的情况,那么就需要在不停止服务的前提下进行重新加载配置,有如下两种解决方式:添加--web.enable-lifecycle参数,启动服务 kill -1 PID # 重载配置或者访问 /-/reload 接口...原创 2020-12-06 16:59:13 · 4168 阅读 · 0 评论 -
Prometheus 修改targets端口
修改目的:打开prometheus,选择targets可以看到下面的页面,目的就是修改红框中的端口。 修改方式:修改prometheus.yml 配置文件,增加如下配置: 配置详细解释:relabel_configs 重新标记配置 - source_labels 源标签 regex 根据此正则表达式取源标签的内容 target_label 目的标签 replacement 操作...原创 2020-10-10 18:45:53 · 2207 阅读 · 1 评论