Commit 6aac8610 by David Kaltschmidt

Explore: Fix click to filter for recording rule expressions

- recording rule names contain ':'
- include this in the pattern for metric names
parent fe9d86c0
......@@ -15,7 +15,7 @@ const builtInWords = [
.join('|')
.split('|');
const metricNameRegexp = /([A-Za-z]\w*)\b(?![\(\]{=!",])/g;
const metricNameRegexp = /([A-Za-z:][\w:]*)\b(?![\(\]{=!",])/g;
const selectorRegexp = /{([^{]*)}/g;
// addLabelToQuery('foo', 'bar', 'baz') => 'foo{bar="baz"}'
......
......@@ -28,6 +28,7 @@ describe('addLabelToQuery()', () => {
expect(addLabelToQuery('foo{instance="my-host.com:9100"}', 'bar', 'baz')).toBe(
'foo{bar="baz",instance="my-host.com:9100"}'
);
expect(addLabelToQuery('foo:metric:rate1m', 'bar', 'baz')).toBe('foo:metric:rate1m{bar="baz"}');
expect(addLabelToQuery('foo{list="a,b,c"}', 'bar', 'baz')).toBe('foo{bar="baz",list="a,b,c"}');
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment