mirror of
https://github.com/grafana/grafana.git
synced 2025-01-04 13:17:16 -06:00
Made tag_values query more robust
This commit is contained in:
parent
e4e042e389
commit
33aa3f0fc5
@ -168,7 +168,9 @@ function (angular, _, dateMath) {
|
||||
return $q.when([]);
|
||||
}
|
||||
|
||||
var keysArray = keys.split(",");
|
||||
var keysArray = keys.split(",").map(function(key) {
|
||||
return key.trim();
|
||||
});
|
||||
var key = keysArray[0];
|
||||
var keysQuery = key + "=*";
|
||||
|
||||
|
@ -55,14 +55,14 @@ describe('opentsdb', function() {
|
||||
ctx.ds.metricFindQuery('tag_values(cpu, hostname, env=$env)').then(function(data) { results = data; });
|
||||
ctx.$rootScope.$apply();
|
||||
expect(requestOptions.url).to.be('/api/search/lookup');
|
||||
expect(requestOptions.params.m).to.be('cpu{hostname=*, env=$env}');
|
||||
expect(requestOptions.params.m).to.be('cpu{hostname=*,env=$env}');
|
||||
});
|
||||
|
||||
it('tag_values(cpu, test) should generate lookup query', function() {
|
||||
ctx.ds.metricFindQuery('tag_values(cpu, hostname, env=$env, region=$region)').then(function(data) { results = data; });
|
||||
ctx.$rootScope.$apply();
|
||||
expect(requestOptions.url).to.be('/api/search/lookup');
|
||||
expect(requestOptions.params.m).to.be('cpu{hostname=*, env=$env, region=$region}');
|
||||
expect(requestOptions.params.m).to.be('cpu{hostname=*,env=$env,region=$region}');
|
||||
});
|
||||
|
||||
it('suggest_tagk() should generate api suggest query', function() {
|
||||
|
Loading…
Reference in New Issue
Block a user