当前位置:网站首页>prometheus api删除某个指定job的所有数据
prometheus api删除某个指定job的所有数据
2022-07-07 14:03:00 【shy_snow】
修改job的name后发现数据重复了,不想删除所有的数据,只想删除其中一个job之前的数据,从网上看到有api可以删除。
首先,要通过prometheus启动参数–web.enable-admin-api 来开启admin HTTP API的访问。
#停止prometheus
ps -ef |grep -v grep | grep prometheus.yml | awk '{print $2}' | xargs kill
#增加--web.enable-admin-api后启动prometheus
nohup /home/xxx/prometheus-2.25.2.linux-amd64/prometheus --config.file=prometheus.yml --web.enable-admin-api --web.enable-lifecycle > nohup.out 2>&1 &
然后就可以选择合适方式来删除数据:
#删除与某个标签匹配的所有时间序列指标
curl -X POST -g 'http://localhost:9090/api/v1/admin/tsdb/delete_series?match[]={kubernetes_name="redis"}'
#删除 job 任务或者 instance 的数据指标:
curl -X POST -g 'http://localhost:9090/api/v1/admin/tsdb/delete_series?match[]={job="youjobname"}'
curl -X POST -g 'http://localhost:9090/api/v1/admin/tsdb/delete_series?match[]={instance="192.168.129.110:9090"}'
#Prometheus 中删除所有的数据,可以使用如下命令:
curl -X POST -g 'http://localhost:9090/api/v1/admin/tsdb/delete_series?match[]={__name__=~".+"}'
边栏推荐
- 121. The best time to buy and sell stocks
- 分步式监控平台zabbix
- 尤雨溪,来了!
- Numpy -- data cleaning
- Three. JS introductory learning notes 08:orbitcontrols JS plug-in - mouse control model rotation, zoom in, zoom out, translation, etc
- The inevitable trend of the intelligent development of ankerui power grid is that microcomputer protection devices are used in power systems
- U3D_ Infinite Bessel curve
- Apache Doris刚“毕业”:为什么应关注这种SQL数据仓库?
- When opening the system window under UE4 shipping, the problem of crash is attached with the plug-in download address
- numpy--疫情数据分析案例
猜你喜欢
LeetCode1_ Sum of two numbers
Virtual memory, physical memory /ram what
LeetCode2_ Add two numbers
Streaming end, server end, player end
尤雨溪,来了!
A wave of open source notebooks is coming
星瑞格数据库入围“2021年度福建省信息技术应用创新典型解决方案”
Xcode Revoke certificate
Numpy --- basic learning notes
Apache Doris刚“毕业”:为什么应关注这种SQL数据仓库?
随机推荐
Regular expression string
Iterator and for of.. loop
Unity3D_ Class fishing project, bullet rebound effect is achieved
Syntax of generator function (state machine)
20th anniversary of agile: a failed uprising
Xcode Revoke certificate
Simple understanding and application of TS generics
如何在shell中实现 backspace
统计学习方法——感知机
Leetcode-231-2的幂
markdown公式编辑教程
[wechat applet] Chapter (5): basic API interface of wechat applet
Strengthen real-time data management, and the British software helps the security construction of the medical insurance platform
Postman generate timestamp, future timestamp
Whole process analysis of unity3d rendering pipeline
Unity drawing plug-in = = [support the update of the original atlas]
Vite path alias @ configuration
Three. JS introductory learning notes 18: how to export JSON files with Blender
Shader Language
Numpy -- data cleaning