Alerting notification preview: Remove private annotations and labels from alert instance payload (#100410)
This commit is contained in:
+7
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user