当前位置:网站首页>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__=~".+"}'
边栏推荐
- Asynchronous application of generator function
- 航天宏图信息中标乌鲁木齐某单位数据库系统研发项目
- Use moviepy Editor clips videos and intercepts video clips in batches
- Shader Language
- Webcodecs parameter settings -avc1.42e01e meaning
- Clang compile link ffmpeg FAQ
- Simple understanding and application of TS generics
- Notification uses full resolution
- Unity的三种单例模式(饿汉,懒汉,MonoBehaviour)
- 用手机在通达信上开户靠谱吗?这样炒股有没有什么安全隐患
猜你喜欢
Notification uses full resolution

Postman generate timestamp, future timestamp

C4D learning notes 2- animation - timeline and time function

Numpy -- data cleaning

Sysom case analysis: where is the missing memory| Dragon lizard Technology

Multiplication in pytorch: mul (), multiply (), matmul (), mm (), MV (), dot ()

Unity3D_ Class fishing project, control the distance between collision walls to adapt to different models

持续创作,还得靠它!

20th anniversary of agile: a failed uprising

Use of SVN
随机推荐
UE4 exports the picture + text combination diagram through ucanvasrendertarget2d
Migration and reprint
通知Notification使用全解析
MySQL数据库基本操作-DQL-基本查询
VS2005 strange breakpoint is invalid or member variable value cannot be viewed
Function: JS Click to copy content function
What about the pointer in neural network C language
Rongyun won the 2022 China Xinchuang digital office portal excellence product award!
Aerospace Hongtu information won the bid for the database system research and development project of a unit in Urumqi
Whole process analysis of unity3d rendering pipeline
Ue4/ue5 multi thread development attachment plug-in download address
leetcode 241. Different Ways to Add Parentheses 为运算表达式设计优先级(中等)
Continuous creation depends on it!
How does geojson data merge the boundaries of regions?
Shader Language
Unity3D_ Class fishing project, control the distance between collision walls to adapt to different models
招标公告:盘锦市人民医院盘锦医院数据库维保项目
hellogolang
Wireless sensor networks -- ZigBee and 6LoWPAN
Syntax of generator function (state machine)