【博客639】Life of a label in prometheus

news/2025/2/15 15:01: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.ppmy.cn/news/246365.html

相关文章

day 49 :121. 买卖股票的最佳时机;122. 买卖股票的最佳时机 II;123. 买卖股票的最佳时机 III

买卖股票 121. 买卖股票的最佳时机:一次买入卖出1. 贪心算法2. 动态规划1. dp数组以及下标名义2. 递归公式3. dp数组如何初始化4. 代码 122. 买卖股票的最佳时机 II:可以多次买入卖出2. 动态规划1. dp数组以及下标名义2. 递归公式3. dp数组如何初始化4. 代码 123. 买…

Web3.0概念

学习web3您需要先掌握 JavaScript node React 后续 我们将学习一门新的语言 叫 Solidity 他是一种只能合约语言开发 我们利用web3将不再依赖后端 而是连接只能合约开发 首先 我们先不用急着写代码 还是要概念为先 首先 我们来对比 WEB1.0到3.0的概念 首先 web1.0 更多处于信…

unity 开发中10个小知识(一)

现在记忆力越来越差&#xff0c;写过很多遍的内容&#xff0c;都有可能需要慢慢才能想起来&#xff0c;这里就记录下在unity开发过程中一些小的知识点 一、获取unity层级和layerMask int ground LayerMask.NameToLayer("Ground"); int groundMask 1<<ground…

Qt/GUI/布局/实现窗口折叠效果/且在操作时父窗口尺寸跟随变动

文章目录 概述无法resize到小尺寸可行方案其他方案 概述 本文旨在&#xff0c;实现如下所示的显示或隐藏 ‘附加选项’ 的效果&#xff0c;以折的不常用信息和操作项&#xff0c;减少普通用户负担&#xff0c;提升用户体验。在某些软件中此类窗口折叠效果&#xff0c;常用 “……

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

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

springboot源码分析-jar启动

概述 Spring Boot 提供了 Maven 插件 spring-boot-maven-plugin&#xff0c;可以方便的将 Spring Boot 项目打成 jar 包或者 war 包。 SpringBoot 是如何通过jar包启动的 java -jar做了什么&#xff1f;看看官网怎么说 If the -jar option is specified, its argument is the …

通达信l1l2行情接口是什么?

通达信l1l2行情接口是什么&#xff1f;L1L2是指L1L2范数&#xff0c;范数理解为”空间两点之间的距离“这个概念被扩展了。 权重w可以理解为高维向量&#xff0c;也可以理解为高维空间中的一个点。如果从这个点到原点的距离是欧洲距离&#xff0c;那就是L2范数&#xff0c;如图…

如何调用通达信l2行情接口?

如何调用通达信l2行情接口&#xff1f;今天小编&#xff0c;就用这三个场景说明一下&#xff0c;如下&#xff1a; 1、API平台生成公钥&#xff0c;发布公钥并提供给需要连接API的人员。 2、Tradex涵盖市场接收、访问、管理和定制&#xff0c;实现一揽子解决方式。 3、量化接…