首页 > 解决方案 > 如何在 victoriametrics 中传递“--web.enable-admin-api”标志

问题描述

要启用删除操作,我们可能需要启用该--web.enable-admin-api'标志,以便我们如何启用它。我目前正在使用非 docker 单节点集群版本并尝试在 curl 命令下运行

curl -X DELETE -g 'http://localhost:8481/api/v1/0/tsdb/delete_series?match[]={foo.bar.baz="bar"}'

标签: curlprometheusvictoriametrics

解决方案


VictoriaMetrics 中的删除 API开箱即用。无需启用它。

看起来您的命令delete API在单节点 VictoriaMetrics 中包含无效的端口和路径。根据文档尝试以下命令:

curl -g 'http://localhost:8428/api/v1/admin/tsdb/delete_series?match[]={foo.bar.baz="bar"}'

请注意,match[]arg 必须使用url encoding正确编码。否则,它可能会被不当转移到 VictoriaMetrics。


推荐阅读