【博客639】Life of a label in prometheus

news2024/9/8 23:50:48

prometheus中label的生命周期

前言

Prometheus labels allow you to model your application deployment in the manner best suited to your organisation. As directly supporting every potential configurations would be impossible, we offer relabelling to give you the flexibility to configure things how you’d like.

How labels propagate can be a bit tricky to get your head around initially. The basic principle is that your service discovery provides you with metadata such as machine type, tags, region in _meta* labels, and which you then relabel into the labels you’d like for your targets to have with relabel_configs. You can also filter targets with the drop and keep actions.

Similarly when actually scraping the targets, metric_relabel_configs allow you to tweak the timeseries coming back from the scrape. Filtering can also be used as a temporary measure to deal with expensive metrics.

Life of a label

To help you understanding how this all fits together, I’ve put together flowcharts of the semantics in Prometheus. These cover from how targets are created, scraped and what manipulations are performed before timeseries are inserted into the database:

在这里插入图片描述

As this point Prometheus knows the targets that’ll be scraped, and these are what you see on the Status page. The core here is the relabelling in purple. Everything else is defaults and sanity checks to make your life easier.
When a target is actually scraped, this is what happens:

在这里插入图片描述

The _param* labels contain the first value of each URL parameter, allowing you to relabel the first value. At scrape time, these are combined back with the second and subsequent parameter values.

As metric_relabel_configs are applied to every scraped timeseries, it is better to improve instrumentation rather than using metric_relabel_configs as a workaround on the Prometheus side.

注意:

label的生命周期分为两大环节:

  • scrap created(创建好后scrap target,可以进行relabl调整或者放弃scrap)
  • actual scraped(抓取后到入库前,可以使用metrics relabel进行最后的调整)

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/617305.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Paxos算法

组成 Paxos算法有proposer, accepter, leaner三种角色节点,其中proposer有点像客户端,而accepter是存储节点。 持久化需要 basic-Paxos是二阶段进行的 第一阶段 propose发起prepare请求,带上rnd accpeter如果发现rnd,比如自己…

图论在数学建模中的应用及MATLAB实现

2023年9月数学建模国赛期间提供ABCDE题思路加Matlab代码,专栏链接(赛前一个月恢复源码199,欢迎大家订阅):http://t.csdn.cn/Um9Zd 目录 图论基本概念 图论原理 1. 最短路径问题 2. 最小生成树问题 MATLAB实现 1. 创建图 2. 最短路径算法 3. 最小生成树算法 数学建模案…

第一章 小程序入门

文章目录 前言一、❎ 环境搭建1、AppID2、设置外观和代理3、小程序项目构成小程序的基本结构小程序的页面组成部分 4、JSON 配置文件JSON 配置文件的作用app.json 配置文件project.config.json 配置文件sitemap.json 配置文件页面 .json 配置文件 5、WXML 模板什么是 wxmlwxml …

Java --- springboot3之web静态资源配置

目录 一、静态资源规则 二、欢迎页规则 三、favicon.ioc规则 四、HTTP缓存机制 五、自定义静态资源规则 5.1、配置方式 5.2、代码方式 一、静态资源规则 Override public void addResourceHandlers(ResourceHandlerRegistry registry) {if (!this.resourceProperties.is…

UA-ModelCompiler 的编译和使用

UA-ModelCompiler 是OPCFoundation的开源程序,它实现将NodeSet 的xml 文件编译成C# 的类,以便结合到UA Server 中。同时,它也能够将一种简便的模型xml 文档(ModelDesgin.xml) 转换成为NodeSet2.xml 。 最近的项目中要使用UA-ModelCompiler &…

【C++】C++ 右值 相关常见问题

【C】C 右值 相关常见问题 文章目录 【C】C 右值 相关常见问题1.介绍一下左值引用和右值引用1.1左值和左值引用1.2右值和右值引用 2.左值引用与右值引用比较3.左值引用的使用场景4. move语义5.完美转发 C 11 关于右值相关概念: 在 C 中,右值是指仅作为表…

【3DsMAX】从零开始建房(3)

目录 步骤 1. 统一材质 2. 制作椅子 3. 制作货物盒 步骤 1. 统一材质 选中所有的模型,按下M键打开材质编辑器 选择精简材质编辑器 选择64示例窗 可以随便选中一个材质球,然后将材质指定给选定对象 然后可以修改线框颜色为黑色 2. 制作椅子 激活…

【力扣周赛】第348场周赛

【力扣周赛】第348场周赛 2716. 最小化字符串长度题目描述解题思路 2717. 半有序排列题目描述解题思路 2718. 查询后矩阵的和题目描述解题思路 2719. 统计整数数目题目描述解题思路 2716. 最小化字符串长度 题目描述 描述:给你一个下标从 0 开始的字符串 s &#…

30个接口自动化测试面试题,看过的已经在上班了

1. 什么是接口自动化测试? 答:接口自动化测试是指使用自动化工具对接口进行测试,验证接口的正确性、稳定性和性能等方面的指标。2. 为什么要进行接口自动化测试? 答:接口自动化测试可以提高测试效率,减少人…

STM32 实现简单定时任务调度器,动态创建任务,两种思路实现跑马灯

代码实现和硬件没关系,所以并不限于STM32,Arduino 之类的其他地方也能用,只要有一个能获取时间的函数就行,或者说,只要有一个会随着时间自动增加的变量就行,时间单位无所谓,所以确实想的话&…

地图实火!断货加印,限时折扣抢购通道开启

(关注公众号点击图片三折购买《社交泛娱乐出海作战地图》) 实火! 融云自制《社交泛娱乐出海作战地图》 “WICC 泛娱乐出海嘉年华”最热单品 关注【融云全球互联网通信云】了解更多 《出海作战地图》线下首发立刻引爆现场,“如…

分布式数据库-事务一致性

version: v-2023060601 author: 路__ 一、什么是“强一致性” 分布式数据库的“强一致性”应该包含两个方面:serializability(串行) and linearizability(线性一致),上述图为“Highly Available Transact…

Tomcat优化与动静分离

Tomcat优化 一、Tomcat配置文件参数优化二、负载均衡,动静分离七层代理配置四层代理配置 Tomcat 默认安装下的缺省配置并不适合生产环境,它会频繁出现假死现象需要重启,只有通过不断压测优化才能让它最高效率稳定的运行。优化主要包括三方面&…

二、tienchin健身系统技术点复现-注解限流

二、tienchin健身系统技术点复现-注解限流 在上一章节写到编写 lua 脚本。基本的配置类都已经创建,下面创建一个 请求获取IP的工具类和全局异常处理即可。 1、创建工具类IpUtils package com.yangjiapo.rate_limiter.utils;import javax.servlet.http.HttpServlet…

Spark RDD实现分组排行榜

文章目录 一,提出任务二,实现思路三,准备工作1、在本地创建成绩文件2、将成绩文件上传到HDFS上指定目录 四,完成任务1、在Spark Shell里完成任务(1)读取成绩文件得到RDD(2)利用映射算…

kafka系统的架构

系统的架构 主题topic和分区partition topic Kafka中存储数据的逻辑分类;你可以理解为数据库中“表”的概念; 比如,将app端日志、微信小程序端日志、业务库订单表数据分别放入不同的topic partition分区(提升kafka吞吐量&#…

有以下类定义,写出该类的构造函数,析构函数,拷贝构造函数,要求,所有类对象的空间都是用new动态申请。

有以下类定义&#xff0c;写出该类的构造函数&#xff0c;析构函数&#xff0c;拷贝构造函数&#xff0c;要求&#xff0c;所有类对象的空间都是用new动态申请。 class Stu {string name;int age;int score;int *high; }; #include <iostream> using namespace std; clas…

XSS-labs靶场通关

目录 level 1 ​level 2 level 3 level 4 level 5 level 6 level 7 level 8 level 9 level 10 level 11 level 12 level 13 level 14 level 15 level 16 level 17 level 18 今天就要开始打xss-labs靶场了&#xff0c;点击图片开始吧 level 1 查看源码发现没…

Android系统的Ashmem匿名共享内存子系统分析(3)- Ashmem子系统的 C/C++访问接口

声明 其实对于Android系统的Ashmem匿名共享内存系统早就有分析的想法&#xff0c;记得2019年6、7月份Mr.Deng离职期间约定一起对其进行研究的&#xff0c;但因为我个人问题没能实施这个计划&#xff0c;留下些许遗憾…文中参考了很多书籍及博客内容&#xff0c;可能涉及的比较…

基于深度学习的高精度人体摔倒行为检测识别系统(PyTorch+Pyside6+YOLOv5模型)

摘要&#xff1a;基于深度学习的高精度人体摔倒行为检测识别系统可用于日常生活中或野外来检测与定位人体摔倒行为目标&#xff0c;利用深度学习算法可实现图片、视频、摄像头等方式的人体摔倒行为目标检测识别&#xff0c;另外支持结果可视化与图片或视频检测结果的导出。本系…