Alerting notification preview: Remove private annotations and labels from alert instance payload (#100410)

This commit is contained in:
Pepe Cano
2025-02-19 11:00:07 +01:00
committed by GitHub
parent 1fdb36022d
commit 953263f91b
@@ -60,6 +60,13 @@ export function AlertInstanceModalSelector({
if (!rules[instance.labels.alertname]) {
rules[instance.labels.alertname] = [];
}
const filteredAnnotations = Object.fromEntries(
Object.entries(instance.annotations).filter(([key]) => !key.startsWith('__'))
);
const filteredLabels = Object.fromEntries(
Object.entries(instance.labels).filter(([key]) => !key.startsWith('__'))
);
instance = { ...instance, annotations: filteredAnnotations, labels: filteredLabels };
rules[instance.labels.alertname].push(instance);
});
}