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 ...
随机推荐
- 云服务器挂载/dev/vdb1磁盘
1.首先检查是否有一块硬盘还未被挂载 2.如图所示,vdb还未被使用,开始分配它吧 [root@localhost ~]# fdisk /dev/vdb Command (m for help): n ...
- js动态创建元素之一--document.write
以我曾经写过的例子举例 如上图,乡镇街道的名字和数目是根据数据库的数据获取的,有几个乡镇,就会显示出来几个,这就要求动态获取乡镇名称和数目,以下代码中用到了document.write创建动态页面,在 ...
- js 学习之路8:for循环
1. for循环 <!DOCTYPE html> <html> <meta http-equiv="Content-Type" content=&qu ...
- dynalist 配额
2018-8-29 dynalist 配额 提示有一个G的配额 就是使用的流量用光了.仅有1个G
- Thirft简单使用
安装Thrift 到thrift官网下载thrift.exe http://thrift.apache.org/download 将thrift-0.10.0.exe复制到C:\Program Fil ...
- Installing Supervisor and Superlance on CentOS
Installing Supervisor1 and Superlance2 on CentOS/RHEL/Fedora can be a little tricky, as the versions ...
- 文本分类实战(九)—— ELMO 预训练模型
1 大纲概述 文本分类这个系列将会有十篇左右,包括基于word2vec预训练的文本分类,与及基于最新的预训练模型(ELMo,BERT等)的文本分类.总共有以下系列: word2vec预训练词向量 te ...
- CentOS下部署Redis集群
一.部署环境 服务器三台: 10.10.15.41(配置运行两个实例,端口:6379,6380) 10.10.15.42(配置运行两个实例,端口:6381,6382) 10.10.15.43(配置运行 ...
- Openwrt无线中继设置并访问外网
Openwrt无线中继设置并访问外网 本篇博文参考来自:http://blog.csdn.net/pifangsione/article/details/13162023 配置目标 主路由器使用AP模 ...
- 前端——HTML
HTML HTML叫做超文本标记语言,是一种制作万维网页面标准语言.相当于定义一套规则,大家都来遵守它,这样浏览器就可以去解释它. 浏览器负责将标签翻译成用户看得懂的格式,呈现给用户. 作为开发者需要 ...