随笔分类 -  监控

prometheus类型
摘要:Counter:只增。 # 查找过去1分钟增长量 sum(increase(prometheus_http_request_count{}[1m])) Gauge:可增可减。 # 查找瞬时值 sum(prometheus_http_request_gauge{}) Histograms:样本落在桶中 阅读全文

posted @ 2024-03-29 19:58 王景迁 阅读(38) 评论(0) 推荐(0)

prometheus自定义注册表
摘要:// 在自定义注册表中只有需要的变量,没有默认的Go运行时指标和prometheus指标 registry := prometheus.NewRegistry() test:= prometheus.NewCounter(prometheus.CounterOpts{ Name: "test", H 阅读全文

posted @ 2024-03-29 19:44 王景迁 阅读(37) 评论(0) 推荐(0)

prometheus增加和删除labels
摘要:在Prometheus中,一个metric可以有多个label,label由key和value组成。 import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prom 阅读全文

posted @ 2024-03-28 20:04 王景迁 阅读(399) 评论(0) 推荐(0)

导航