mirror of
https://github.com/grafana/grafana.git
synced 2025-02-14 01:23:32 -06:00
Explore: Fix click to filter for recording rule expressions
- recording rule names contain ':' - include this in the pattern for metric names
This commit is contained in:
parent
fe9d86c070
commit
6aac8610eb
@ -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"}');
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user