mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Initial graphite tags support (#9239)
* graphite: initial seriesByTag() support * graphite: groupByTags() function * graphite: aliasByTags() function * graphite: fix optional params update, issue #9238 * graphite: fix tag-related functions version * graphite: add 1.1.x version to config * graphite: fix seriesByTag() series parsing
This commit is contained in:
committed by
Torkel Ödegaard
parent
4326790bb4
commit
f8b8907cc4
@@ -822,6 +822,49 @@ function (_, $) {
|
||||
version: '1.0'
|
||||
});
|
||||
|
||||
addFuncDef({
|
||||
name: 'seriesByTag',
|
||||
category: categories.Special,
|
||||
params: [
|
||||
{ name: "tagExpression", type: "string" },
|
||||
{ name: "tagExpression", type: "string", optional: true },
|
||||
{ name: "tagExpression", type: "string", optional: true },
|
||||
{ name: "tagExpression", type: "string", optional: true },
|
||||
],
|
||||
version: '1.1'
|
||||
});
|
||||
|
||||
addFuncDef({
|
||||
name: "groupByTags",
|
||||
category: categories.Special,
|
||||
params: [
|
||||
{
|
||||
name: "function",
|
||||
type: "string",
|
||||
options: ['sum', 'avg', 'maxSeries']
|
||||
},
|
||||
{ name: "tag", type: "string" },
|
||||
{ name: "tag", type: "string", optional: true },
|
||||
{ name: "tag", type: "string", optional: true },
|
||||
{ name: "tag", type: "string", optional: true },
|
||||
],
|
||||
defaultParams: ["sum", "tag"],
|
||||
version: '1.1'
|
||||
});
|
||||
|
||||
addFuncDef({
|
||||
name: "aliasByTags",
|
||||
category: categories.Special,
|
||||
params: [
|
||||
{ name: "tag", type: "string" },
|
||||
{ name: "tag", type: "string", optional: true },
|
||||
{ name: "tag", type: "string", optional: true },
|
||||
{ name: "tag", type: "string", optional: true },
|
||||
],
|
||||
defaultParams: ["tag"],
|
||||
version: '1.1'
|
||||
});
|
||||
|
||||
_.each(categories, function(funcList, catName) {
|
||||
categories[catName] = _.sortBy(funcList, 'name');
|
||||
});
|
||||
@@ -873,7 +916,7 @@ function (_, $) {
|
||||
// if string contains ',' and next param is optional, split and update both
|
||||
if (this._hasMultipleParamsInString(strValue, index)) {
|
||||
_.each(strValue.split(','), function(partVal, idx) {
|
||||
this.updateParam(partVal.trim(), idx);
|
||||
this.updateParam(partVal.trim(), index + idx);
|
||||
}.bind(this));
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user