Prometheus和Alertmanager中是否可以有动态groupBy?

mof*_*tje 6 prometheus prometheus-alertmanager

在我的 Prometheus 警报配置中,我有一些很棒的summary注释,包含不同的标签。

- alert: PodsPending
  expr: kube_pod_status_phase{phase="Pending"} > 0
  labels:
    severity: high
  annotations:
    summary: "Namespace {{$labels.namespace}} has pods stuck in Pending"
- alert: Failures
  expr: sum(application_responses_percent{status="500"}) by (environment, app, otherlabel) > 80
  for: 5m
  labels:
    severity: high
  annotations:
    summary: "({{$labels.environment}}) Too many errors in {{$labels.app}}"
Run Code Online (Sandbox Code Playgroud)

在 Alertmanager 中,我想按这些摘要对警报进行分组。这样,分组依据的标签集可以是每个警报的动态,因为它们是摘要的一部分。

但是,由于它summary是一个注释,因此不能直接在AlertmanagersgroupBy配置中使用,因为它只能使用标签。如何使用摘要或其他动态方式对警报进行分组?

我尝试检查metric-relabel-config注释是否可以转换为标签,但那里没有注释数据。