Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想查询 Prometheus,好像我的集群指标超过了某个阈值,然后我想检查我的哪些主机超过了特定阈值,并最终根据该主机触发一个脚本。
假设您有一个名为 的标签cluster,那么您可以执行以下操作:
cluster
metric > 5 and on (cluster) avg by (cluster)(metric > 10)
如果集群的指标平均值超过 10,它将返回超过 5 个的每个实例。