@ -1,5 +1,6 @@
import { isEmpty } from 'lodash' ;
import { encodeMatcher } from 'app/features/alerting/unified/utils/matchers' ;
import { dispatch } from 'app/store/store' ;
import { ReceiversStateDTO } from 'app/types/alerting' ;
@ -17,13 +18,13 @@ import {
} from '../../../../plugins/datasource/alertmanager/types' ;
import { NotifierDTO } from '../../../../types' ;
import { withPerformanceLogging } from '../Analytics' ;
import { matcherToOperator } from '../utils/alertmanager' ;
import { matcherToMatcherField } from '../utils/alertmanager' ;
import {
GRAFANA_RULES_SOURCE_NAME ,
getDatasourceAPIUid ,
isVanillaPrometheusAlertManagerDataSource ,
} from '../utils/datasource' ;
import { retryWhile , wrapWithQuotes } from '../utils/misc' ;
import { retryWhile } from '../utils/misc' ;
import { messageFromError , withSerializedError } from '../utils/redux' ;
import { alertingApi } from './alertingApi' ;
@ -72,9 +73,9 @@ export const alertmanagerApi = alertingApi.injectEndpoints({
// TODO Add support for active, silenced, inhibited, unprocessed filters
const filterMatchers = filter ? . matchers
? . filter ( ( matcher ) = > matcher . name && matcher . value )
. map (
( matcher ) = > ` ${ wrapWithQuotes ( matcher . name ) } ${ matcherToOperator ( matcher ) } ${ wrapWithQuotes ( matcher . value ) } `
) ;
. map ( ( matcher ) = > {
return encodeMatcher ( matcherToMatcherField ( matcher ) ) ;
} ) ;
const { silenced , inhibited , unprocessed , active } = filter || { } ;