本文介绍了如何从 Prometheus 中删除旧作业?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两份工作.一个是新的,另一个是旧的.需要删除旧的,这样它也会从 Grafana 仪表板中删除.

I have 2 jobs. one is new and other one is old. Need to delete old one, so that it will get removed from Grafana dashboard too.

提前致谢...

推荐答案

扩展 evgenyl 的答案,确切的命令类似于:

Expanding on evgenyl's answer, the exact command would be something like:

curl -X POST -g 'http://localhost:9090/api/v1/admin/tsdb/delete_series?match[]={job="name_of_old_job"}'

将 name_of_old_job 替换为您要删除的作业的名称.

Replace name_of_old_job with the name of the job you want deleted.

提醒您需要使用 --web.enable-admin-api 标志启动 prometheus

Reminder that you need to have started prometheus with the --web.enable-admin-api flag

这篇关于如何从 Prometheus 中删除旧作业?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-17 00:27