如何在 Prometheus 中获取以特定单词开头的指标以及在 prometheus.yml 文件中更新的内容

How to get metrics starting with particular words in Prometheus and what to update in prometheus.yml file

我想过滤掉 prometheus 中以特定单词开头的指标,它应该显示所有出现的情况

使用以下查询:

{__name__=~"STRING.+"}

如果您想使用 REST API 执行搜索:

curl --globoff --request GET "http://PROMETHEUS-SERVER/api/v1/query?query={__name__=~'prom.%2B'}"