0

有谁知道如何从 metricbeat k8s 模块获取 webhook 警报有效负载中的 Kubernetes 命名空间?或者更一般地说,如何访问要包含在有效负载中的事件数据?

我使用本指南在 Kubernetes 上安装了 metricbeat:在 Kubernetes 上运行 Metricbeat | Metricbeat 参考 [7.15] | 松紧带

我得到了这个数据:

在此处输入图像描述

但是,当我创建一个 webhook 警报时,使用此有效负载可以查看所有可用属性:

alert: {{alert}}
context: {{context}}

这是唯一包含的数据:

alert: {\"id\":\"ubuntu\",\"actionGroup\":\"metrics.inventory_threshold.fired\",\"actionGroupName\":\"Alert\"}

context:
{\"group\":\"ubuntu\",\"alertState\":\"ALERT\",\"reason\":\"CPU usage is greater than a threshold of 80 (current value is 99.9%)\",\"timestamp\":\"2021-10-14T22:56:11.799Z\",\"value\":{\"condition0\":\"99.9%\"},\"threshold\":{\"condition0\":[80]},\"metric\":{\"condition0\":\"cpu\"}}

任何人都知道如何将kubernetes.namespace从源包含到警报有效负载中?我需要它能够唯一地识别警报中的 pod。

4

0 回答 0