prometheus 标签使用
标签的配置使用
考虑到要明智地使用标签,我们需要给事物重新命名。在一个集中的、复杂的监视环境中,我们有时无法控制正在监视的所有资源以及它们公开的监视数据。重新标记允许在自己的环境中控制、管理和潜在地标准化度量。
常见的用例是 :
- 删除不必要的指标。
- 从指标中删除敏感或不需要的签。
- 添加、编辑或修改指标的签值格式。
删除metrics
scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']
metric_relabel_configs:
- source_labels: [__name__]
separator: ','
regex: '(process_cpu_seconds_total|process_open_fds)'
action: drop
- job_name: 'node_exporter'
static_configs:
- targets: ['localhost:9100']
params:
collect[]:
- cpu
- meminfo
- diskstats
- job_name: 'docker'
static_configs:
- targets: ['192.168.31.151:8080']

备注:如果我们指定了多个源标签,需要用 ; 分开:
regex1;regex2;regex3
替换标签
实际上是根据已有的标签,生成一个新标签


scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']
metric_relabel_configs:
- source_labels: [__name__]
separator: ','
regex: '(process_cpu_seconds_total|process_open_fds)'
action: drop
- source_labels: [version]
regex: 'go1.*'
replacement: 'go_unknown'
target_label: go_version
- job_name: 'node_exporter'
static_configs:
- targets: ['localhost:9100']
params:
collect[]:
- cpu
- meminfo
- diskstats
- job_name: 'docker'
static_configs:
- targets: ['192.168.31.151:8080']

删除标签


scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']
metric_relabel_configs:
- source_labels: [__name__]
separator: ','
regex: '(process_cpu_seconds_total|process_open_fds)'
action: drop
- source_labels: [version]
regex: 'go1.*'
replacement: 'go_unknown'
target_label: go_version
- regex: 'version'
action: labeldrop
- job_name: 'node_exporter'
static_configs:
- targets: ['localhost:9100']
params:
collect[]:
- cpu
- meminfo
- diskstats
- job_name: 'docker'
static_configs:
- targets: ['192.168.31.151:8080']
prometheus 标签使用的更多相关文章
- Prometheus 标签使用示例整合
Prometheus 监控实例 一.Prometheus 根据标签聚合总CPU使用率 1.主机添加标签(可在多个主机内添加相同标签实现聚合):vim prometheus.conf static_co ...
- prometheus 标签修改promSQL
relabel_configs 根据prometheus 监控k8s配置文件中学习 未修改前默认配置文件: 网页显示: 修改配置文件后: 网页显示: 服务发现网页: 总结: 在数据采集之前对任何目标的 ...
- Prometheus 运维监控
Prometheus 运维监控 1.Prometheus 介绍详解 2.Prometheus 安装部署 3.Prometheus 配置文件详解 4.Prometheus PromSQL 常用资源 5. ...
- Prometheus联邦
联邦使得一个 Prometheus 服务器可以从另一个 Prometheus 服务器提取选定的时序. 1. 使用场景 Prometheus 联邦有不同的使用场景.通常,联邦被用来实现可扩展的 Prom ...
- 了解Prometheus
了解Prometheus 标签(空格分隔): 监控 介绍 Prometheus是用来收集和存储服务器的实时数据(比如:CPU.硬盘.服务响应.日志等),通过其丰富的运算函数,可以计算得到很多的服务性能 ...
- Kubernetes 监控--Prometheus
在早期的版本中 Kubernetes 提供了 heapster.influxDB.grafana 的组合来监控系统,在现在的版本中已经移除掉了 heapster,现在更加流行的监控工具是 Promet ...
- Kubernetes日志系统新贵Loki-Stack
Loki简介 Grafana Loki是可以组成功能齐全的日志记录堆栈的一组组件. 与其他日志记录系统不同,Loki是基于仅索引有关日志的元数据的想法而构建的:标签(就像Prometheus标签一样) ...
- Loki日志系统
一.概述 背景 Loki的第一个稳定版本于2019年11月19日发布,是 Grafana Labs 团队最新的开源项目,是一个水平可扩展,高可用性,多租户的日志聚合系统. Grafana 对 Loki ...
- Grafana Loki 架构
转载自:https://mp.weixin.qq.com/s?__biz=MzU4MjQ0MTU4Ng==&mid=2247492186&idx=2&sn=a06954384a ...
随机推荐
- C#的自动拼接Sql语句Insert方法及思路
思路: 1.想想插入语句,大概是这样的一个框架:INSERT INTO 表名 (数据库列名) values (值) 2.这里要3个变量是不固定的,分别是:表名.数据库列名.值: a.表名我们这里很容易 ...
- python3 正则表达式点星问号(.*?)能不能匹配换行符?不能的话应该怎么写
python3的re模块使用过程中,正则的书写遇到了一些问题,就是使用.*?能不能匹配到换行符的问题. 答案是不能. 如果在匹配过程中遇到了也没关系,加上这个语句就好: \s+
- Cs231n课堂内容记录-Lecture 9 深度学习模型
Lecture 9 CNN Architectures 参见:https://blog.csdn.net/qq_29176963/article/details/82882080#GoogleNet_ ...
- 完成代码将x插入到该顺序有序线性表中,要求该线性表依然有序
#include <stdio.h> #include <malloc.h> int main(void) { int i, n; double s = 1.3; double ...
- python进阶之正则表达式
概念: 正则表达式是对字符串操作的一种逻辑公式,就是用事先定义好的一些特定字符.及这些特定字符的组合,组成一个“规则字符串”,这个“规则字符串”用来表达对字符串的一种过滤逻辑. 目的? 给定一个正则表 ...
- About Pull Strings 英语走后门议论文
About pull strings Author : Pleiades_Antares 1. From ancient times to the present, the "going b ...
- (生活)Photoshop入门(不定时更新)
我可能是想找个工作以外的事情做一下. 目标:我要自学网PhotoShop商业修图. 笔记: .图层 .1总结: 1.1.1图层就好像画画的一张纸,但是每一层又互不影响. 1.1.2图层蒙版(覆盖一层玻 ...
- SpringBoot使用JSP(官网Demo)
最开始接触java的时候,前端页面基本都是用jsp来写,最近公司项目要使用SpringBoot重构,查看SpringBoot文档,发现SpringBoot不建议使用JSP,因为jsp在使用内嵌serv ...
- springBoot2.0+redis+fastJson+自定义注解实现方法上添加过期时间
springBoot2.0集成redis实例 一.首先引入项目依赖的maven jar包,主要包括 spring-boot-starter-data-redis包,这个再springBoot2.0之前 ...
- java遍历复杂json字符串获取想要的数据
https://blog.csdn.net/qq_34309663/article/details/80508125 java如何解析复杂的json数据关于json处理的包有好几个,比如jackson ...