1、启动参数
- "--web.enable-lifecycle" #重新加载配置文件 - "--web.enable-admin-api" #接口调用
2、重新加载
与alertmanager重新加载配置一样
alertmanager例子: http://192.168.1.44:9093/-/reload
#删除与某个标签匹配的所有时间序列指标
curl -X POST -g 'http://localhost:9090/api/v1/admin/tsdb/delete_series?match[]={job="pushgateway"}'curl -X POST -g 'http://localhost:9090/api/v1/admin/tsdb/delete_series?match[]={source="energy_pushgateway"}'
#Prometheus 中删除所有的数据,可以使用如下命令:
curl -X POST -g 'http://localhost:9090/api/v1/admin/tsdb/delete_series?match[]={__name__=~".+"}'curl -X POST -g 'http://localhost:9090/api/v1/admin/tsdb/delete_series?match[]={__name__=~".+"}'