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 ...
随机推荐
- 【转贴】一次 JDBC 与 MySQL 因 “CST” 时区协商误解导致时间差了 14 或 13 小时的排错经历
原文:https://juejin.im/post/5902e087da2f60005df05c3d ------------------------------------------------- ...
- vue(2)—— vue简单语法运用,常用指令集
按照前面的文章:vue(1)——node.js安装使用,利用npm安装vue 安装完vue之后,就可以使用vue了 vue vue简介 前面安装好vue之后,确实还没有对vue进行介绍,首先,官网: ...
- 【公众号系列】SAP HANA和区块链
公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[公众号系列]SAP HANA和区块链 写在 ...
- 【原】Java学习笔记004 - 运算符
package cn.temptation; public class Sample01 { public static void main(String[] args) { // 运算符:对常量 或 ...
- mysql8.0版本修改密码
登录之后使用如下命令: ALTER USER 'root'@'localhost' IDENTIFIED BY "你的新密码"; 还有不知是不是因为mysql版本问题,一开始设置的 ...
- GMM算法的matlab程序
GMM算法的matlab程序 在“GMM算法的matlab程序(初步)”这篇文章中已经用matlab程序对iris数据库进行简单的实现,下面的程序最终的目的是求准确度. 作者:凯鲁嘎吉 - 博客园 h ...
- Extjs 改变grid行的背景颜色
## Ext grid 改变行背景色 Ext.util.CSS.createStyleSheet('.ts {background:#9a9a9bc2;}');//单独创建css样式 { xtype: ...
- Python基础——8错误、调试和测试
捕捉错误 try: print('try...') r = 10 / int('2') print('result:', r) except ValueError as e: print('Value ...
- Spring的单例模式底层实现
http://blog.csdn.net/cs408/article/details/48982085
- .net 获取远程访问的ip
这两天一直做获取远程访问的ip和自己的ip相关的问题. 在解决获取ip相关问题的时候,主要使用了上下文对象,httpcontext对象.原理很简单,内部有两大对象,request和response.里 ...