当前位置:网站首页>解决pushgateway数据多次推送会覆盖的问题
解决pushgateway数据多次推送会覆盖的问题
2022-07-03 15:02:00 【Initial-T】
问题
多个client,往同一台pushgateway推送数据时,采用同一个job名称,会发现始终只能留下一个client的数据,其他的会被覆盖
使用语言 python
分析
通过抓包发现,所有数据均已推送到9091端口,所以排除是某个client推送的问题
代码
push_to_gateway(pushgateway_url, job=job_name, registry=registry)
相当于推送到了 metrics/job/job_name
问题原因
推送的指标按组进行管理,由任意数量标签的分组键标识,一般有Job跟instance,推送时候只指定Job的话,会误将几个server推送的数据当成同一组数据,出现覆盖的情况
所以应该在分组标识中加入该批数据的唯一标识,即推送的链接应该为该批数据的唯一指定存放位置,类似门牌号的概念。只用job的话相当于都推到同一个位置了。
解决
推送到 metrics/job/job_name/instance/id即可
在这里可以推到 metrics/job/job_name/client/client_name
参照python库的用法
https://github.com/prometheus/client_python
改为下述代码即可成功推送
push_to_gateway(pushgateway_url, job=job_name, registry=registry,grouping_key={"client":client_name})
边栏推荐
- 【注意力机制】【首篇ViT】DETR,End-to-End Object Detection with Transformers网络的主要组成是CNN和Transformer
- [ue4] geometry drawing pipeline
- [graphics] hair simulation in tressfx
- [opengl] geometry shader
- C language STR function
- [opengl] bone animation blending effect
- . Net six design principles personal vernacular understanding, please correct if there is any error
- Web server code parsing - thread pool
- Global and Chinese market of Bus HVAC systems 2022-2028: Research Report on technology, participants, trends, market size and share
- Global and Chinese market of lighting control components 2022-2028: Research Report on technology, participants, trends, market size and share
猜你喜欢
B2020 分糖果
Qt development - scrolling digital selector commonly used in embedded system
Dllexport and dllimport
High quality workplace human beings must use software to recommend, and you certainly don't know the last one
链表有环,快慢指针走3步可以吗
创业团队如何落地敏捷测试,提升质量效能?丨声网开发者创业讲堂 Vol.03
[graphics] efficient target deformation animation based on OpenGL es 3.0
Yolov5系列(一)——网络可视化工具netron
cpu飙升排查方法
Besides lying flat, what else can a 27 year old do in life?
随机推荐
There are links in the linked list. Can you walk three steps faster or slower
[opengl] geometry shader
Chapter 14 class part 1
Tensor 省略号(三个点)切片
. Net six design principles personal vernacular understanding, please correct if there is any error
【pytorch学习笔记】Datasets and Dataloaders
C language DUP function
Centos7 deployment sentry redis (with architecture diagram, clear and easy to understand)
CentOS7部署哨兵Redis(带架构图,清晰易懂)
Detailed explanation of four modes of distributed transaction (Seata)
PS tips - draw green earth with a brush
4-29——4.32
TPS61170QDRVRQ1
B2020 分糖果
什么是one-hot encoding?Pytorch中,将label变成one hot编码的两种方式
Zzuli:1054 monkeys eat peaches
Yolov5系列(一)——網絡可視化工具netron
Optical cat super account password and broadband account password acquisition
Open under vs2019 UI file QT designer flash back problem
Zzuli: cumulative sum of 1050 factorials