diff --git a/public/app/features/alerting/unified/utils/alertmanager.test.ts b/public/app/features/alerting/unified/utils/alertmanager.test.ts index a349e14960c..c5495df3612 100644 --- a/public/app/features/alerting/unified/utils/alertmanager.test.ts +++ b/public/app/features/alerting/unified/utils/alertmanager.test.ts @@ -1,6 +1,6 @@ import { Matcher } from 'app/plugins/datasource/alertmanager/types'; import { Labels } from 'app/types/unified-alerting-dto'; -import { parseMatcher, parseMatchers, stringifyMatcher, labelsMatchMatchers } from './alertmanager'; +import { parseMatcher, parseMatchers, labelsMatchMatchers } from './alertmanager'; describe('Alertmanager utils', () => { describe('parseMatcher', () => { @@ -55,19 +55,6 @@ describe('Alertmanager utils', () => { }); }); - describe('stringifyMatcher', () => { - it('should stringify matcher correctly', () => { - expect( - stringifyMatcher({ - name: 'foo', - value: 'boo="bar"', - isRegex: true, - isEqual: false, - }) - ).toEqual('foo!~"boo=\\"bar\\""'); - }); - }); - describe('parseMatchers', () => { it('should parse all operators', () => { expect(parseMatchers('foo=bar, bar=~ba.+, severity!=warning, email!~@grafana.com')).toEqual([ diff --git a/public/app/features/alerting/unified/utils/alertmanager.ts b/public/app/features/alerting/unified/utils/alertmanager.ts index 117ec24750d..6e33c32bec7 100644 --- a/public/app/features/alerting/unified/utils/alertmanager.ts +++ b/public/app/features/alerting/unified/utils/alertmanager.ts @@ -99,14 +99,6 @@ function unescapeMatcherValue(value: string) { return trimmed.replace(/\\"/g, '"'); } -function escapeMatcherValue(value: string) { - return '"' + value.replace(/"/g, '\\"') + '"'; -} - -export function stringifyMatcher(matcher: Matcher): string { - return `${matcher.name}${matcherToOperator(matcher)}${escapeMatcherValue(matcher.value)}`; -} - export function parseMatcher(matcher: string): Matcher { const trimmed = matcher.trim(); if (trimmed.startsWith('{') && trimmed.endsWith('}')) {