Alerting: Add label filters to the logic of showing hidden instances (#65674)

* Add label filters to the logic of showing hidden instances

Co-authored-by: Virginia Cepeda <virginia.cepeda@grafana.com>

* Add tests

Co-Authored-By: Sonia Aguilar <33540275+soniaAguilarPeiron@users.noreply.github.com>

---------

Co-authored-by: Virginia Cepeda <virginia.cepeda@grafana.com>
This commit is contained in:
Sonia Aguilar
2023-04-03 15:39:06 +02:00
committed by GitHub
parent 96453c6e69
commit 008bf143ac
4 changed files with 97 additions and 26 deletions

View File

@@ -35,6 +35,7 @@ import {
} from 'app/types/unified-alerting';
import {
AlertQuery,
GrafanaAlertState,
GrafanaAlertStateDecision,
GrafanaRuleDefinition,
PromAlertingRuleState,
@@ -630,3 +631,7 @@ export function getCloudRule(override?: Partial<CombinedRule>) {
...override,
});
}
export function mockAlertWithState(state: GrafanaAlertState, labels?: {}): Alert {
return { activeAt: '', annotations: {}, labels: labels || {}, state: state, value: '' };
}