├── .travis.yml ├── run-tests.sh ├── docs ├── gnocchi-logo.jpg ├── gnocchi-logo.png ├── grafana-dynamic.png ├── collectd-dashboard.png ├── gnocchi_templating.png ├── grafana-metric-id.png ├── gnocchi_query_mode1.png ├── gnocchi_query_mode3.png ├── gnocchi_query_mode4.png └── add_datasource_gnocchi.png ├── dist ├── docs │ ├── gnocchi-logo.jpg │ ├── gnocchi-logo.png │ ├── grafana-dynamic.png │ ├── collectd-dashboard.png │ ├── gnocchi_templating.png │ ├── grafana-metric-id.png │ ├── gnocchi_query_mode1.png │ ├── gnocchi_query_mode3.png │ ├── gnocchi_query_mode4.png │ └── add_datasource_gnocchi.png ├── partials │ ├── query.options.html │ ├── config.html │ └── query.editor.html ├── specs │ └── mocks │ │ ├── templatesrv.js.map │ │ ├── templatesrv.js │ │ ├── backendsrv.js.map │ │ └── backendsrv.js ├── module.js.map ├── snippets │ ├── gnocchiquery.js │ └── gnocchioperations.js ├── ace-loader.js ├── module.js ├── plugin.json ├── mode-gnocchiquery.js ├── mode-gnocchioperations.js ├── README.md ├── completer.js.map ├── completer.js ├── query_ctrl.js.map ├── query_ctrl.js ├── LICENSE └── datasource.js.map ├── src ├── partials │ ├── query.options.html │ ├── config.html │ └── query.editor.html ├── specs │ └── mocks │ │ ├── templatesrv.ts │ │ └── backendsrv.ts ├── snippets │ ├── gnocchiquery.js │ └── gnocchioperations.js ├── module.ts ├── ace-loader.js ├── mode-gnocchiquery.js ├── mode-gnocchioperations.js ├── completer.ts └── query_ctrl.ts ├── .mergify.yml ├── .gitignore ├── plugin.json ├── karma.conf.js ├── tslint.json ├── package.json ├── Gruntfile.js ├── CHANGELOG ├── release.sh ├── README.md └── LICENSE /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | dist: xenial 3 | node_js: 4 | - "8" 5 | script: ./run-tests.sh 6 | -------------------------------------------------------------------------------- /run-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd $(readlink -f $(dirname $0)) 3 | exec node_modules/grunt-cli/bin/grunt $* 4 | -------------------------------------------------------------------------------- /docs/gnocchi-logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnocchixyz/grafana-gnocchi-datasource/HEAD/docs/gnocchi-logo.jpg -------------------------------------------------------------------------------- /docs/gnocchi-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnocchixyz/grafana-gnocchi-datasource/HEAD/docs/gnocchi-logo.png -------------------------------------------------------------------------------- /docs/grafana-dynamic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnocchixyz/grafana-gnocchi-datasource/HEAD/docs/grafana-dynamic.png -------------------------------------------------------------------------------- /dist/docs/gnocchi-logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnocchixyz/grafana-gnocchi-datasource/HEAD/dist/docs/gnocchi-logo.jpg -------------------------------------------------------------------------------- /dist/docs/gnocchi-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnocchixyz/grafana-gnocchi-datasource/HEAD/dist/docs/gnocchi-logo.png -------------------------------------------------------------------------------- /docs/collectd-dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnocchixyz/grafana-gnocchi-datasource/HEAD/docs/collectd-dashboard.png -------------------------------------------------------------------------------- /docs/gnocchi_templating.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnocchixyz/grafana-gnocchi-datasource/HEAD/docs/gnocchi_templating.png -------------------------------------------------------------------------------- /docs/grafana-metric-id.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnocchixyz/grafana-gnocchi-datasource/HEAD/docs/grafana-metric-id.png -------------------------------------------------------------------------------- /dist/docs/grafana-dynamic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnocchixyz/grafana-gnocchi-datasource/HEAD/dist/docs/grafana-dynamic.png -------------------------------------------------------------------------------- /docs/gnocchi_query_mode1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnocchixyz/grafana-gnocchi-datasource/HEAD/docs/gnocchi_query_mode1.png -------------------------------------------------------------------------------- /docs/gnocchi_query_mode3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnocchixyz/grafana-gnocchi-datasource/HEAD/docs/gnocchi_query_mode3.png -------------------------------------------------------------------------------- /docs/gnocchi_query_mode4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnocchixyz/grafana-gnocchi-datasource/HEAD/docs/gnocchi_query_mode4.png -------------------------------------------------------------------------------- /dist/docs/collectd-dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnocchixyz/grafana-gnocchi-datasource/HEAD/dist/docs/collectd-dashboard.png -------------------------------------------------------------------------------- /dist/docs/gnocchi_templating.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnocchixyz/grafana-gnocchi-datasource/HEAD/dist/docs/gnocchi_templating.png -------------------------------------------------------------------------------- /dist/docs/grafana-metric-id.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnocchixyz/grafana-gnocchi-datasource/HEAD/dist/docs/grafana-metric-id.png -------------------------------------------------------------------------------- /dist/partials/query.options.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 | -------------------------------------------------------------------------------- /docs/add_datasource_gnocchi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnocchixyz/grafana-gnocchi-datasource/HEAD/docs/add_datasource_gnocchi.png -------------------------------------------------------------------------------- /src/partials/query.options.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 | -------------------------------------------------------------------------------- /dist/docs/gnocchi_query_mode1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnocchixyz/grafana-gnocchi-datasource/HEAD/dist/docs/gnocchi_query_mode1.png -------------------------------------------------------------------------------- /dist/docs/gnocchi_query_mode3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnocchixyz/grafana-gnocchi-datasource/HEAD/dist/docs/gnocchi_query_mode3.png -------------------------------------------------------------------------------- /dist/docs/gnocchi_query_mode4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnocchixyz/grafana-gnocchi-datasource/HEAD/dist/docs/gnocchi_query_mode4.png -------------------------------------------------------------------------------- /dist/docs/add_datasource_gnocchi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnocchixyz/grafana-gnocchi-datasource/HEAD/dist/docs/add_datasource_gnocchi.png -------------------------------------------------------------------------------- /src/specs/mocks/templatesrv.ts: -------------------------------------------------------------------------------- 1 | export default class TemplateSrvMock { 2 | replace(value: string, format: any){ 3 | return value; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /.mergify.yml: -------------------------------------------------------------------------------- 1 | pull_request_rules: 2 | - name: ask to resolve conflict 3 | conditions: 4 | - conflict 5 | actions: 6 | comment: 7 | message: This pull request is now in conflicts. Could you fix it @{{author}}? 8 | -------------------------------------------------------------------------------- /dist/specs/mocks/templatesrv.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"templatesrv.js","sourceRoot":"","sources":["../../../src/specs/mocks/templatesrv.ts"],"names":[],"mappings":";;AAAA;IAAA;IAIA,CAAC;IAHG,iCAAO,GAAP,UAAQ,KAAa,EAAE,MAAW;QAC9B,MAAM,CAAC,KAAK,CAAC;IACjB,CAAC;IACL,sBAAC;AAAD,CAAC,AAJD,IAIC"} -------------------------------------------------------------------------------- /dist/module.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"module.js","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":";;AACA,2CAAiD;AAY1B,qBAZd,8BAAiB,CAYO;AAXjC,2CAA0D;AAY1B,oBAZvB,uCAA0B,CAYM;AAVzC;IAAA;IAEA,CAAC;IADU,6BAAW,GAAG,sBAAsB,CAAC;IAChD,wBAAC;CAAA,AAFD,IAEC;AASsB,uCAAU;AAPjC;IAAA;IAEA,CAAC;IADU,mCAAW,GAAG,6BAA6B,CAAC;IACvD,8BAAC;CAAA,AAFD,IAEC;AAM4B,mDAAgB"} -------------------------------------------------------------------------------- /dist/specs/mocks/templatesrv.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | var TemplateSrvMock = /** @class */ (function () { 4 | function TemplateSrvMock() { 5 | } 6 | TemplateSrvMock.prototype.replace = function (value, format) { 7 | return value; 8 | }; 9 | return TemplateSrvMock; 10 | }()); 11 | exports.default = TemplateSrvMock; 12 | //# sourceMappingURL=templatesrv.js.map -------------------------------------------------------------------------------- /dist/snippets/gnocchiquery.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/gnocchiquery",["require","exports","module"], function(require, exports, module) { 2 | "use strict"; 3 | 4 | // exports.snippetText = "# rate\n\ 5 | // snippet r\n\ 6 | // rate(${1:metric}[${2:range}])\n\ 7 | // "; 8 | 9 | exports.snippets = []; 10 | // { 11 | // "content": "host = 'foobar'", 12 | // "name": "host", 13 | // "scope": "gnocchiquery", 14 | // "tabTrigger": "h" 15 | // } 16 | //]; 17 | 18 | exports.scope = "gnocchiquery"; 19 | }); 20 | 21 | -------------------------------------------------------------------------------- /src/snippets/gnocchiquery.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/gnocchiquery",["require","exports","module"], function(require, exports, module) { 2 | "use strict"; 3 | 4 | // exports.snippetText = "# rate\n\ 5 | // snippet r\n\ 6 | // rate(${1:metric}[${2:range}])\n\ 7 | // "; 8 | 9 | exports.snippets = []; 10 | // { 11 | // "content": "host = 'foobar'", 12 | // "name": "host", 13 | // "scope": "gnocchiquery", 14 | // "tabTrigger": "h" 15 | // } 16 | //]; 17 | 18 | exports.scope = "gnocchiquery"; 19 | }); 20 | 21 | -------------------------------------------------------------------------------- /dist/snippets/gnocchioperations.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/gnocchioperation",["require","exports","module"], function(require, exports, module) { 2 | "use strict"; 3 | 4 | // exports.snippetText = "# rate\n\ 5 | // snippet r\n\ 6 | // rate(${1:metric}[${2:range}])\n\ 7 | // "; 8 | 9 | exports.snippets = []; 10 | // { 11 | // "content": "host = 'foobar'", 12 | // "name": "host", 13 | // "scope": "gnocchioperation", 14 | // "tabTrigger": "h" 15 | // } 16 | //]; 17 | 18 | exports.scope = "gnocchioperation"; 19 | }); 20 | 21 | -------------------------------------------------------------------------------- /src/module.ts: -------------------------------------------------------------------------------- 1 | 2 | import { GnocchiDatasource } from './datasource'; 3 | import { GnocchiDatasourceQueryCtrl } from './query_ctrl'; 4 | 5 | class GnocchiConfigCtrl { 6 | static templateUrl = 'partials/config.html'; 7 | } 8 | 9 | class GnocchiQueryOptionsCtrl { 10 | static templateUrl = 'partials/query.options.html'; 11 | } 12 | 13 | export { 14 | GnocchiDatasource as Datasource, 15 | GnocchiDatasourceQueryCtrl as QueryCtrl, 16 | GnocchiConfigCtrl as ConfigCtrl, 17 | GnocchiQueryOptionsCtrl as QueryOptionsCtrl, 18 | }; 19 | -------------------------------------------------------------------------------- /src/snippets/gnocchioperations.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/snippets/gnocchioperation",["require","exports","module"], function(require, exports, module) { 2 | "use strict"; 3 | 4 | // exports.snippetText = "# rate\n\ 5 | // snippet r\n\ 6 | // rate(${1:metric}[${2:range}])\n\ 7 | // "; 8 | 9 | exports.snippets = []; 10 | // { 11 | // "content": "host = 'foobar'", 12 | // "name": "host", 13 | // "scope": "gnocchioperation", 14 | // "tabTrigger": "h" 15 | // } 16 | //]; 17 | 18 | exports.scope = "gnocchioperation"; 19 | }); 20 | 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | 5 | # Runtime data 6 | pids 7 | *.pid 8 | *.seed 9 | 10 | # Directory for instrumented libs generated by jscoverage/JSCover 11 | lib-cov 12 | 13 | # Coverage directory used by tools like istanbul 14 | coverage 15 | 16 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 17 | .grunt 18 | 19 | # Compiled binary addons (http://nodejs.org/api/addons.html) 20 | build/Release 21 | 22 | # Dependency directory 23 | # Deployed apps should consider commenting this line out: 24 | # see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git 25 | node_modules 26 | src/.baseDir.ts 27 | .tscache 28 | -------------------------------------------------------------------------------- /dist/ace-loader.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | if ("ace" in window){ 4 | ace.config.setModuleUrl( 5 | "ace/mode/gnocchiquery", 6 | "public/plugins/gnocchixyz-gnocchi-datasource/mode-gnocchiquery.js" 7 | ); 8 | 9 | ace.config.setModuleUrl( 10 | "ace/snippets/gnocchiquery", 11 | "public/plugins/gnocchixyz-gnocchi-datasource/snippets/gnocchiquery.js" 12 | ); 13 | 14 | ace.config.setModuleUrl( 15 | "ace/mode/gnocchioperations", 16 | "public/plugins/gnocchixyz-gnocchi-datasource/mode-gnocchioperations.js" 17 | ); 18 | 19 | ace.config.setModuleUrl( 20 | "ace/snippets/gnocchioperations", 21 | "public/plugins/gnocchixyz-gnocchi-datasource/snippets/gnocchioperations.js" 22 | ); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/ace-loader.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | if ("ace" in window){ 4 | ace.config.setModuleUrl( 5 | "ace/mode/gnocchiquery", 6 | "public/plugins/gnocchixyz-gnocchi-datasource/mode-gnocchiquery.js" 7 | ); 8 | 9 | ace.config.setModuleUrl( 10 | "ace/snippets/gnocchiquery", 11 | "public/plugins/gnocchixyz-gnocchi-datasource/snippets/gnocchiquery.js" 12 | ); 13 | 14 | ace.config.setModuleUrl( 15 | "ace/mode/gnocchioperations", 16 | "public/plugins/gnocchixyz-gnocchi-datasource/mode-gnocchioperations.js" 17 | ); 18 | 19 | ace.config.setModuleUrl( 20 | "ace/snippets/gnocchioperations", 21 | "public/plugins/gnocchixyz-gnocchi-datasource/snippets/gnocchioperations.js" 22 | ); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/specs/mocks/backendsrv.ts: -------------------------------------------------------------------------------- 1 | 2 | import * as _ from "lodash"; 3 | 4 | export default class BackendSrvMock { 5 | constructor(private $http) { 6 | } 7 | 8 | datasourceRequest(options) { 9 | var self = this; 10 | options.retry = options.retry || 0; 11 | return self.$http(options).then(function(data){ 12 | return data; 13 | }, function(err) { 14 | //populate error obj on Internal Error 15 | if (_.isString(err.data) && err.status === 500) { 16 | err.data = { 17 | error: err.statusText 18 | }; 19 | } 20 | 21 | if (err.data && !err.data.message && _.isString(err.data.error)) { 22 | err.data.message = err.data.error; 23 | } 24 | 25 | throw err; 26 | }); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /dist/module.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | var datasource_1 = require("./datasource"); 4 | exports.Datasource = datasource_1.GnocchiDatasource; 5 | var query_ctrl_1 = require("./query_ctrl"); 6 | exports.QueryCtrl = query_ctrl_1.GnocchiDatasourceQueryCtrl; 7 | var GnocchiConfigCtrl = /** @class */ (function () { 8 | function GnocchiConfigCtrl() { 9 | } 10 | GnocchiConfigCtrl.templateUrl = 'partials/config.html'; 11 | return GnocchiConfigCtrl; 12 | }()); 13 | exports.ConfigCtrl = GnocchiConfigCtrl; 14 | var GnocchiQueryOptionsCtrl = /** @class */ (function () { 15 | function GnocchiQueryOptionsCtrl() { 16 | } 17 | GnocchiQueryOptionsCtrl.templateUrl = 'partials/query.options.html'; 18 | return GnocchiQueryOptionsCtrl; 19 | }()); 20 | exports.QueryOptionsCtrl = GnocchiQueryOptionsCtrl; 21 | //# sourceMappingURL=module.js.map -------------------------------------------------------------------------------- /dist/specs/mocks/backendsrv.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"backendsrv.js","sourceRoot":"","sources":["../../../src/specs/mocks/backendsrv.ts"],"names":[],"mappings":";;AACA,0BAA4B;AAE5B;IACI,wBAAoB,KAAK;QAAL,UAAK,GAAL,KAAK,CAAA;IACzB,CAAC;IAED,0CAAiB,GAAjB,UAAkB,OAAO;QACvB,IAAI,IAAI,GAAG,IAAI,CAAC;QAChB,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC;QACnC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,UAAS,IAAI;YACzC,MAAM,CAAC,IAAI,CAAC;QAChB,CAAC,EAAE,UAAS,GAAG;YACb,sCAAsC;YACtC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,CAAC,CAAC,CAAC;gBAC/C,GAAG,CAAC,IAAI,GAAG;oBACT,KAAK,EAAE,GAAG,CAAC,UAAU;iBACtB,CAAC;YACJ,CAAC;YAED,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBAChE,GAAG,CAAC,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC;YACpC,CAAC;YAED,MAAM,GAAG,CAAC;QACZ,CAAC,CAAC,CAAC;IACL,CAAC;IACL,qBAAC;AAAD,CAAC,AAxBD,IAwBC"} -------------------------------------------------------------------------------- /plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | "name": "Gnocchi", 4 | "type": "datasource", 5 | "id": "gnocchixyz-gnocchi-datasource", 6 | 7 | "defaultMatchFormat": "glob", 8 | "metrics": true, 9 | "annotations": false, 10 | 11 | "staticRoot": ".", 12 | 13 | "info": { 14 | "description": "Gnocchi Datasource", 15 | "author": { 16 | "name": "Mehdi ABAAKOUK", 17 | "url": "https://github.com/gnocchixyz" 18 | }, 19 | "logos": { 20 | "small": "docs/gnocchi-logo.png", 21 | "large": "docs/gnocchi-logo.png" 22 | }, 23 | "links": [ 24 | {"name": "Gnocchi", "url": "http://gnocchi.xyz"}, 25 | {"name": "GitHub", "url": "https://github.com/gnocchixyz/grafana-gnocchi-datasource"}, 26 | {"name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0"} 27 | ], 28 | "screenshots": [ 29 | ], 30 | "version": "1.7.1", 31 | "updated": "2018-03-20" 32 | }, 33 | 34 | "dependencies": { 35 | "grafanaVersion": "3.x.x", 36 | "plugins": [ ] 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /dist/plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | "name": "Gnocchi", 4 | "type": "datasource", 5 | "id": "gnocchixyz-gnocchi-datasource", 6 | 7 | "defaultMatchFormat": "glob", 8 | "metrics": true, 9 | "annotations": false, 10 | 11 | "staticRoot": ".", 12 | 13 | "info": { 14 | "description": "Gnocchi Datasource", 15 | "author": { 16 | "name": "Mehdi ABAAKOUK", 17 | "url": "https://github.com/gnocchixyz" 18 | }, 19 | "logos": { 20 | "small": "docs/gnocchi-logo.png", 21 | "large": "docs/gnocchi-logo.png" 22 | }, 23 | "links": [ 24 | {"name": "Gnocchi", "url": "http://gnocchi.xyz"}, 25 | {"name": "GitHub", "url": "https://github.com/gnocchixyz/grafana-gnocchi-datasource"}, 26 | {"name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0"} 27 | ], 28 | "screenshots": [ 29 | ], 30 | "version": "1.7.1", 31 | "updated": "2018-03-20" 32 | }, 33 | 34 | "dependencies": { 35 | "grafanaVersion": "3.x.x", 36 | "plugins": [ ] 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /dist/specs/mocks/backendsrv.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | var _ = require("lodash"); 4 | var BackendSrvMock = /** @class */ (function () { 5 | function BackendSrvMock($http) { 6 | this.$http = $http; 7 | } 8 | BackendSrvMock.prototype.datasourceRequest = function (options) { 9 | var self = this; 10 | options.retry = options.retry || 0; 11 | return self.$http(options).then(function (data) { 12 | return data; 13 | }, function (err) { 14 | //populate error obj on Internal Error 15 | if (_.isString(err.data) && err.status === 500) { 16 | err.data = { 17 | error: err.statusText 18 | }; 19 | } 20 | if (err.data && !err.data.message && _.isString(err.data.error)) { 21 | err.data.message = err.data.error; 22 | } 23 | throw err; 24 | }); 25 | }; 26 | return BackendSrvMock; 27 | }()); 28 | exports.default = BackendSrvMock; 29 | //# sourceMappingURL=backendsrv.js.map -------------------------------------------------------------------------------- /karma.conf.js: -------------------------------------------------------------------------------- 1 | module.exports = function(config) { 2 | 'use strict'; 3 | 4 | config.set({ 5 | frameworks: ['browserify', 'mocha', 'expect'], 6 | 7 | plugins : [ 8 | 'karma-browserify', 9 | 'karma-mocha', 10 | 'karma-expect', 11 | 'karma-phantomjs-launcher' 12 | ], 13 | 14 | // list of files / patterns to load in the browser 15 | files: [ 16 | 'node_modules/es6-shim/es6-shim.js', 17 | 'node_modules/systemjs/dist/system.src.js', 18 | 'node_modules/angular/angular.js', 19 | 'node_modules/angular-mocks/angular-mocks.js', 20 | 'node_modules/lodash/lodash.js', 21 | 'dist/specs/gnocchi-datasource-specs.js', 22 | ], 23 | 24 | preprocessors: { 25 | 'dist/specs/gnocchi-datasource-specs.js': ['browserify'], 26 | }, 27 | 28 | // list of files to exclude 29 | exclude: [], 30 | 31 | reporters: ['dots'], 32 | port: 9876, 33 | colors: true, 34 | logLevel: config.LOG_INFO, 35 | autoWatch: true, 36 | browsers: ['PhantomJS'], 37 | captureTimeout: 20000, 38 | singleRun: true, 39 | autoWatchBatchDelay: 1000, 40 | browserNoActivityTimeout: 60000, 41 | browserify: {debug:true} 42 | 43 | }); 44 | 45 | }; 46 | 47 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "class-name": true, 4 | "comment-format": [false, "check-space"], 5 | "curly": true, 6 | "eofline": true, 7 | "forin": false, 8 | "indent": [true, "spaces"], 9 | "label-position": true, 10 | "max-line-length": [true, 140], 11 | "member-access": false, 12 | "no-arg": true, 13 | "no-bitwise": true, 14 | "no-console": [true, 15 | "debug", 16 | "info", 17 | "time", 18 | "timeEnd", 19 | "trace" 20 | ], 21 | "no-construct": true, 22 | "no-debugger": true, 23 | "no-duplicate-variable": true, 24 | "no-empty": false, 25 | "no-eval": true, 26 | "no-inferrable-types": true, 27 | "no-shadowed-variable": false, 28 | "no-string-literal": false, 29 | "no-switch-case-fall-through": false, 30 | "no-trailing-whitespace": true, 31 | "no-unused-expression": false, 32 | "no-unused-variable": false, 33 | "no-var-keyword": false, 34 | "object-literal-sort-keys": false, 35 | "one-line": [true, 36 | "check-open-brace", 37 | "check-catch", 38 | "check-else" 39 | ], 40 | "radix": false, 41 | "semicolon": true, 42 | "triple-equals": [true, "allow-null-check"], 43 | "typedef-whitespace": [true, { 44 | "call-signature": "nospace", 45 | "index-signature": "nospace", 46 | "parameter": "nospace", 47 | "property-declaration": "nospace", 48 | "variable-declaration": "nospace" 49 | }], 50 | "variable-name": [true, "ban-keywords"], 51 | "whitespace": [true, 52 | "check-branch", 53 | "check-decl", 54 | "check-type" 55 | ] 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gnocchixyz-gnocchi-datasource", 3 | "private": true, 4 | "version": "1.7.1", 5 | "description": "Grafana datasource for Gnocchi", 6 | "repository": { 7 | "type": "git", 8 | "url": "git+https://github.com/gnocchixyz/grafana-gnocchi-datasource" 9 | }, 10 | "author": "Mehdi Abaakouk", 11 | "license": "Apache 2.0", 12 | "bugs": { 13 | "url": "http://www.apache.org/licenses/LICENSE-2.0" 14 | }, 15 | "devDependencies": { 16 | "@types/angular": "^1.6.27", 17 | "@types/angular-mocks": "^1.5.10", 18 | "@types/expect.js": "^0.3.29", 19 | "@types/lodash": "^4.14.70", 20 | "@types/mocha": "^2.2.41", 21 | "@types/q": "^1.0.2", 22 | "angular-mocks": "^1.6.5", 23 | "browserify": "^14.4.0", 24 | "es6-promise": "^4.1.1", 25 | "es6-shim": "^0.35.3", 26 | "expect": "^1.20.2", 27 | "expect.js": "^0.3.1", 28 | "grunt": "^1.0.1", 29 | "grunt-angular-templates": "^1.1.0", 30 | "grunt-cli": "^1.2.0", 31 | "grunt-contrib-clean": "^1.1.0", 32 | "grunt-contrib-copy": "^1.0.0", 33 | "grunt-contrib-uglify": "^3.0.1", 34 | "grunt-contrib-watch": "^1.0.0", 35 | "grunt-karma": "^2.0.0", 36 | "grunt-mocha-test": "^0.13.2", 37 | "grunt-systemjs-builder": "^1.0.0", 38 | "grunt-ts": "^6.0.0-beta.16", 39 | "grunt-tslint": "^5.0.1", 40 | "jshint-stylish": "^2.2.1", 41 | "karma": "^1.7.0", 42 | "karma-browserify": "^5.1.1", 43 | "karma-expect": "^1.1.3", 44 | "karma-mocha": "^1.3.0", 45 | "karma-phantomjs-launcher": "^1.0.4", 46 | "load-grunt-tasks": "^3.5.2", 47 | "mocha": "^3.4.2", 48 | "phantomjs-prebuilt": "^2.1.14", 49 | "q": "^1.5.0", 50 | "systemjs": "^0.20.15", 51 | "tslint": "^5.5.0", 52 | "typescript": "^2.4.2", 53 | "watchify": "^3" 54 | }, 55 | "dependencies": { 56 | "angular": "^1.6.5", 57 | "lodash": "^4.17.4", 58 | "moment": "^2.18.1" 59 | }, 60 | "homepage": "https://github.com/gnocchixyz/grafana-gnocchi-datasource" 61 | } 62 | -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function(grunt) { 2 | 3 | require('load-grunt-tasks')(grunt); 4 | 5 | grunt.loadNpmTasks('grunt-contrib-clean'); 6 | grunt.loadNpmTasks('grunt-ts'); 7 | grunt.loadNpmTasks('grunt-tslint'); 8 | grunt.loadNpmTasks('grunt-karma'); 9 | 10 | grunt.initConfig({ 11 | 12 | clean: ["dist/*"], 13 | 14 | ts: { 15 | dist: { 16 | src: ['src/**/*.ts'], 17 | dest: 'dist/', 18 | options: { 19 | rootDir: "src/", 20 | target: 'es5', 21 | module: 'commonjs', 22 | sourceMap: true, 23 | emitDecoratorMetadata: true, 24 | experimentalDecorators: true, 25 | removeComments: false, 26 | noImplicitAny: false, 27 | moduleResolution: "node", 28 | lib: ["dom", "es2015", "es5", "es6"], 29 | typeRoots: ["node_modules/@types"], 30 | } 31 | }, 32 | }, 33 | 34 | tslint: { 35 | source: { files: { src: ['src/**/*.ts'] }}, 36 | options: { configuration: 'tslint.json' } 37 | }, 38 | 39 | copy: { 40 | sources: { 41 | cwd: 'src', 42 | expand: true, 43 | src: ['**/*.html', '**/*.js'], 44 | dest: 'dist/' 45 | }, 46 | staticContent: { 47 | expand: true, 48 | src: ['LICENSE', 'README.md', 'img/*', 'docs/*'], 49 | dest: 'dist/' 50 | }, 51 | plugin: { 52 | src: [ 'plugin.json', 'README.md' ], 53 | dest: 'dist/' 54 | } 55 | }, 56 | 57 | watch: { 58 | rebuild_all: { 59 | files: ['src/**/*', 'plugin.json'], 60 | tasks: ['default'], 61 | options: {spawn: false} 62 | } 63 | }, 64 | 65 | karma: { 66 | test: { 67 | configFile: 'karma.conf.js' 68 | } 69 | }, 70 | }); 71 | 72 | grunt.registerTask('default', [ 73 | 'clean', 74 | 'tslint', 75 | 'copy:sources', 76 | 'copy:plugin', 77 | 'copy:staticContent', 78 | 'ts:dist', 79 | 'karma:test']); 80 | }; 81 | -------------------------------------------------------------------------------- /CHANGELOG: -------------------------------------------------------------------------------- 1 | Version 1.7.0 2 | 3 | * Only retrieve resource attributes needed by the graph 4 | * Allow to groupby "Dynamic Aggregates" and "Resource search" 5 | * Autocompletion for Query, Operations, Metric names and GroupbBy 6 | * Partial syntax highlighting for Query and Operations 7 | * New error reporting handling, label become red when field in invalid. 8 | 9 | Version 1.6.2 10 | 11 | * Use a dropdown for resource types 12 | 13 | Version 1.6.1 14 | 15 | * Allow to have different attributes for templating 16 | (e.g: a dropdown with "$host - $flavor", while template service will use "id") 17 | 18 | Version 1.6.0 19 | 20 | * Add support fore Dynamic Aggregation 21 | * Remove support for Gnocchi transformation 22 | 23 | Version 1.5.5 24 | 25 | * Fix some release script issues 26 | 27 | Version 1.5.4 28 | 29 | * fix multivalue templating variable in template 30 | * fix typo in needed_overlap 31 | * Implements reaggregation 32 | 33 | Version 1.5.3 34 | 35 | * Rework error handling 36 | * Fix github url 37 | * templating: Fix multivalue handling 38 | 39 | Version 1.5.0 40 | 41 | * Behavior of missing datapoints is now configurable (shown as zero or not) 42 | * Add support for Gnocchi transformation 43 | * Custom aggregation method are allowed 44 | 45 | Version 1.4.0 46 | 47 | * Granularity can be set on all query Mode 48 | * $metric in label show the metric name 49 | * Label can be created dynamically with resource attribute prefixed by $ or surrounded by ${} 50 | example: $host - $type - $metric 51 | * Resource aggregation can also aggregate metrics of the same resource 52 | by using regex in metric name 53 | 54 | Version 1.3.1 55 | 56 | * Metric name use regex and not wildcard 57 | * Rework the UI 58 | 59 | Version 1.3.0 60 | 61 | * Metric name can be a wildcard for resource search queries 62 | * The option need_overlap can be set 63 | * Resource attribute used in label must be prefixed by "$" - breaking change 64 | 65 | Version 1.2.0 66 | 67 | * Gnocchi basic auth support 68 | * Allow to express Query in fancy format instead of JSON 69 | 70 | Version 1.1.0 71 | 72 | * Allow to select granularity 73 | * Provide example dashboard that works out of the box for Openstack Ceilometer 74 | -------------------------------------------------------------------------------- /release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Grafana plugin plublisher here: https://grafana.com/plugins/gnocchixyz-gnocchi-datasource 4 | # are built from github, asking are done with PR here: https://github.com/grafana/grafana-plugin-repository 5 | # they release tools clones our git at the asked tag and create a tarball of the dist/ directory. 6 | # So on each release the dist/ up2date 7 | 8 | 9 | set -e 10 | 11 | cd $(readlink -f $(dirname $0)) 12 | 13 | inc_version() { echo $1 | gawk -F"." '{$NF+=1}{print $0RT}' OFS="." ORS="" ;} 14 | get_version() { sed -n 's/.*"version": "\([^"]*\)".*/\1/gp' $1 ; } 15 | error() { echo $1 ; exit 1 ; } 16 | bump_version() { 17 | nextversion=$1 18 | today=$today 19 | 20 | sed -i 's/"version": "[^"]*"/"version": "'$nextversion'"/' plugin.json package.json 21 | sed -i 's/"updated": "[^"]*"/"updated": "'$today'"/' plugin.json 22 | ./run-tests.sh 23 | status=$(git status -sz) 24 | if [ -n "$status" ]; then 25 | git commit -m "Bump version $nextversion" plugin.json package.json dist/ 26 | git push 27 | fi 28 | } 29 | 30 | [ ! "$GITHUB_TOKEN" ] && error "GITHUB_TOKEN is missing" 31 | 32 | today=$(date "+%Y-%m-%d") 33 | 34 | git fetch origin --tags 35 | 36 | if [ "$1" ] ; then 37 | version="$1" 38 | if [ "$(get_version plugin.json)" != "$version" ]; then 39 | bump_version "$version" "$today" 40 | fi 41 | else 42 | version=$(git tag | tail -1) 43 | version=$(inc_version $version) 44 | fi 45 | 46 | # Sanity checks 47 | plugin_version=$(get_version plugin.json) 48 | package_version=$(get_version package.json) 49 | [ "$plugin_version" != "$version" ] && error "plugin.json incorrect version ($plugin_version != $version)" 50 | [ "$package_version" != "$version" ] && error "package.json incorrect version ($package_version != $version" 51 | 52 | echo "Building version $version" 53 | 54 | ./run-tests.sh 55 | 56 | status=$(git status -sz) 57 | [ -z "$status" ] || error "Repo is not clean after dist/ generation" 58 | 59 | echo 60 | echo "release: ${version} ? " 61 | echo 62 | 63 | read 64 | 65 | cp -a dist gnocchixyz-gnocchi-datasource 66 | tar -czf gnocchixyz-gnocchi-datasource-${version}.tar.gz gnocchixyz-gnocchi-datasource 67 | 68 | git tag $version -m "Release version $version" 69 | git push --tags 70 | 71 | github-release release -u gnocchixyz -r grafana-gnocchi-datasource --tag $version --description "Release $version for Grafana 3 and 4" 72 | github-release upload -u gnocchixyz -r grafana-gnocchi-datasource --tag $version --name gnocchixyz-gnocchi-datasource-${version}.tar.gz --file gnocchixyz-gnocchi-datasource-${version}.tar.gz 73 | github-release info -u gnocchixyz -r grafana-gnocchi-datasource --tag $version 74 | 75 | rm -rf gnocchixyz-gnocchi-datasource* 76 | 77 | nextversion=$(inc_version $version) 78 | bump_version "$nextversion" "$today" 79 | 80 | -------------------------------------------------------------------------------- /dist/mode-gnocchiquery.js: -------------------------------------------------------------------------------- 1 | // jshint ignore: start 2 | // jscs: disable 3 | ace.define("ace/mode/gnocchiquery_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { 4 | "use strict"; 5 | 6 | var oop = require("../lib/oop"); 7 | var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; 8 | 9 | var GnocchiQueryHighlightRules = function() { 10 | this.$rules = { 11 | "start" : [ 12 | {token : "keyword.operator.binary", regex: ">=|<=|!=|>|<|=|==|eq|ne|lt|gt|ge|le|like|in|≠|≥|≤"}, 13 | {token : "keyword.operator.link", regex: "and|or|∧|∨"}, 14 | {token : "string", regex : "`", next: "string0"}, 15 | {token : "string", regex : "'", next: "string1"}, 16 | {token : "string", regex : '"', next: "string2"}, 17 | {token : "constant.language", regex : "(?:null|none|None)\\b"}, 18 | {token : "constant.language.boolean", regex: "(?:true|True|false|False)\\b"}, 19 | {token : "constant.numeric", regex : "0[xX][0-9a-fA-F]+\\b" }, 20 | {token : "constant.numeric", regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"}, 21 | {token : "identifier", regex: "\\b[\\[\\]\\$\\{\\}\\w]+\\b"}, 22 | {token : "text", regex : "\\s+"}, 23 | ], 24 | "string0" : [ 25 | {token : "constant.language.escape", regex : "``"}, 26 | {token : "string", regex : "`", next : "start"}, 27 | {defaultToken : "string"} 28 | ], 29 | "string1" : [ 30 | {token : "constant.language.escape", regex : "''"}, 31 | {token : "string", regex : "'", next : "start"}, 32 | {defaultToken : "string"} 33 | ], 34 | "string2" : [ 35 | {token : "constant.language.escape", regex : '""'}, 36 | {token : "string", regex : '"', next : "start"}, 37 | {defaultToken : "string"} 38 | ], 39 | 40 | }; 41 | this.normalizeRules(); 42 | }; 43 | 44 | oop.inherits(GnocchiQueryHighlightRules, TextHighlightRules); 45 | 46 | exports.GnocchiQueryHighlightRules = GnocchiQueryHighlightRules; 47 | }); 48 | 49 | ace.define("ace/mode/gnocchiquery_completions",["require","exports","module","ace/token_iterator", "ace/lib/lang"], function(require, exports, module) { 50 | "use strict"; 51 | 52 | var lang = require("../lib/lang"); 53 | var GnocchiQueryCompletions = function() {}; 54 | 55 | (function() { 56 | this.getCompletions = function(state, session, pos, prefix, callback) { 57 | // dummy completer to avoid unwanted keyword/local completion 58 | return callback(null, []); 59 | }; 60 | 61 | }).call(GnocchiQueryCompletions.prototype); 62 | 63 | exports.GnocchiQueryCompletions = GnocchiQueryCompletions; 64 | }); 65 | 66 | ace.define("ace/mode/gnocchiquery",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/gnocchiquery_highlight_rules"], function(require, exports, module) { 67 | "use strict"; 68 | 69 | var oop = require("../lib/oop"); 70 | var TextMode = require("./text").Mode; 71 | var GnocchiQueryHighlightRules = require("./gnocchiquery_highlight_rules").GnocchiQueryHighlightRules; 72 | var GnocchiQueryCompletions = require("./gnocchiquery_completions").GnocchiQueryCompletions; 73 | 74 | var Mode = function() { 75 | this.HighlightRules = GnocchiQueryHighlightRules; 76 | this.$behaviour = this.$defaultBehaviour; 77 | this.$completer = new GnocchiQueryCompletions(); 78 | this.completer = this.$completer; 79 | }; 80 | oop.inherits(Mode, TextMode); 81 | 82 | (function() { 83 | 84 | this.$id = "ace/mode/gnocchiquery"; 85 | }).call(Mode.prototype); 86 | 87 | exports.Mode = Mode; 88 | 89 | }); 90 | -------------------------------------------------------------------------------- /src/mode-gnocchiquery.js: -------------------------------------------------------------------------------- 1 | // jshint ignore: start 2 | // jscs: disable 3 | ace.define("ace/mode/gnocchiquery_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { 4 | "use strict"; 5 | 6 | var oop = require("../lib/oop"); 7 | var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; 8 | 9 | var GnocchiQueryHighlightRules = function() { 10 | this.$rules = { 11 | "start" : [ 12 | {token : "keyword.operator.binary", regex: ">=|<=|!=|>|<|=|==|eq|ne|lt|gt|ge|le|like|in|≠|≥|≤"}, 13 | {token : "keyword.operator.link", regex: "and|or|∧|∨"}, 14 | {token : "string", regex : "`", next: "string0"}, 15 | {token : "string", regex : "'", next: "string1"}, 16 | {token : "string", regex : '"', next: "string2"}, 17 | {token : "constant.language", regex : "(?:null|none|None)\\b"}, 18 | {token : "constant.language.boolean", regex: "(?:true|True|false|False)\\b"}, 19 | {token : "constant.numeric", regex : "0[xX][0-9a-fA-F]+\\b" }, 20 | {token : "constant.numeric", regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"}, 21 | {token : "identifier", regex: "\\b[\\[\\]\\$\\{\\}\\w]+\\b"}, 22 | {token : "text", regex : "\\s+"}, 23 | ], 24 | "string0" : [ 25 | {token : "constant.language.escape", regex : "``"}, 26 | {token : "string", regex : "`", next : "start"}, 27 | {defaultToken : "string"} 28 | ], 29 | "string1" : [ 30 | {token : "constant.language.escape", regex : "''"}, 31 | {token : "string", regex : "'", next : "start"}, 32 | {defaultToken : "string"} 33 | ], 34 | "string2" : [ 35 | {token : "constant.language.escape", regex : '""'}, 36 | {token : "string", regex : '"', next : "start"}, 37 | {defaultToken : "string"} 38 | ], 39 | 40 | }; 41 | this.normalizeRules(); 42 | }; 43 | 44 | oop.inherits(GnocchiQueryHighlightRules, TextHighlightRules); 45 | 46 | exports.GnocchiQueryHighlightRules = GnocchiQueryHighlightRules; 47 | }); 48 | 49 | ace.define("ace/mode/gnocchiquery_completions",["require","exports","module","ace/token_iterator", "ace/lib/lang"], function(require, exports, module) { 50 | "use strict"; 51 | 52 | var lang = require("../lib/lang"); 53 | var GnocchiQueryCompletions = function() {}; 54 | 55 | (function() { 56 | this.getCompletions = function(state, session, pos, prefix, callback) { 57 | // dummy completer to avoid unwanted keyword/local completion 58 | return callback(null, []); 59 | }; 60 | 61 | }).call(GnocchiQueryCompletions.prototype); 62 | 63 | exports.GnocchiQueryCompletions = GnocchiQueryCompletions; 64 | }); 65 | 66 | ace.define("ace/mode/gnocchiquery",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/gnocchiquery_highlight_rules"], function(require, exports, module) { 67 | "use strict"; 68 | 69 | var oop = require("../lib/oop"); 70 | var TextMode = require("./text").Mode; 71 | var GnocchiQueryHighlightRules = require("./gnocchiquery_highlight_rules").GnocchiQueryHighlightRules; 72 | var GnocchiQueryCompletions = require("./gnocchiquery_completions").GnocchiQueryCompletions; 73 | 74 | var Mode = function() { 75 | this.HighlightRules = GnocchiQueryHighlightRules; 76 | this.$behaviour = this.$defaultBehaviour; 77 | this.$completer = new GnocchiQueryCompletions(); 78 | this.completer = this.$completer; 79 | }; 80 | oop.inherits(Mode, TextMode); 81 | 82 | (function() { 83 | 84 | this.$id = "ace/mode/gnocchiquery"; 85 | }).call(Mode.prototype); 86 | 87 | exports.Mode = Mode; 88 | 89 | }); 90 | -------------------------------------------------------------------------------- /dist/partials/config.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | When "direct" access is used, Gnocchi and Keystone MUST have CORS configured correctly on the server side.

6 |
7 |

Gnocchi Details

8 |
9 |
10 |
11 | Auth Mode 12 |
13 | 14 | 15 | noauth = we send domain/project/username in X--Id headers to Gnocchi
16 | token = we send the X-Token-ID header to Gnocchi
17 | keystone = we retreive the token on keystone with domain/project/username/password 18 |
19 |
20 |
21 |
22 |
23 | noauth is deprecated 24 | The Keystone URL is expected in Http settings 25 | Keystone and Gnocchi must be hosted on same HTTP endpoint (example: http://foobar/identity and http://foobar/metric) 26 | The Gnocchi URL is expected in Http settings 27 |
28 |
29 |
30 |
31 | Domain 32 | 33 |
34 |
35 |
36 |
37 | Project 38 | 39 |
40 |
41 |
42 |
43 | User 44 | 45 |
46 |
47 |
48 |
49 | Password 50 | 51 |
52 |
53 |
54 |
55 | Roles 56 | 57 |
58 |
59 | 60 |
61 |
62 |
63 |
64 | Token 65 | 66 |
67 |
68 |
69 |
70 | -------------------------------------------------------------------------------- /src/partials/config.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | When "direct" access is used, Gnocchi and Keystone MUST have CORS configured correctly on the server side.

6 |
7 |

Gnocchi Details

8 |
9 |
10 |
11 | Auth Mode 12 |
13 | 14 | 15 | noauth = we send domain/project/username in X--Id headers to Gnocchi
16 | token = we send the X-Token-ID header to Gnocchi
17 | keystone = we retreive the token on keystone with domain/project/username/password 18 |
19 |
20 |
21 |
22 |
23 | noauth is deprecated 24 | The Keystone URL is expected in Http settings 25 | Keystone and Gnocchi must be hosted on same HTTP endpoint (example: http://foobar/identity and http://foobar/metric) 26 | The Gnocchi URL is expected in Http settings 27 |
28 |
29 |
30 |
31 | Domain 32 | 33 |
34 |
35 |
36 |
37 | Project 38 | 39 |
40 |
41 |
42 |
43 | User 44 | 45 |
46 |
47 |
48 |
49 | Password 50 | 51 |
52 |
53 |
54 |
55 | Roles 56 | 57 |
58 |
59 | 60 |
61 |
62 |
63 |
64 | Token 65 | 66 |
67 |
68 |
69 |
70 | -------------------------------------------------------------------------------- /dist/mode-gnocchioperations.js: -------------------------------------------------------------------------------- 1 | // jshint ignore: start 2 | // jscs: disable 3 | ace.define("ace/mode/gnocchioperations_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { 4 | "use strict"; 5 | 6 | var oop = require("../lib/oop"); 7 | var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; 8 | 9 | var GnocchiOperationsHighlightRules = function() { 10 | var aggregators = this.createKeywordMapper({ 11 | "aggregator": "mean|median|std|min|max|sum|var|count", 12 | }, "invalid.illegal.aggregator", true); 13 | 14 | var math = this.createKeywordMapper({ 15 | "math": "+|add|%|mod|-|sub|\\*|×|mul|/|÷|div|\\*\\*|pow|^|cos|sin|abs|cos|sin|tan|floor|ceil|neg|rateofchange", 16 | }, "invalid.illegal.operation", true); 17 | 18 | // TODO(sileht): prefix token by ace known name for better color 19 | this.$rules = { 20 | "start": [ 21 | {token: "metric.start", regex: "metric", next: "metric"}, 22 | {token: "constant.numeric", regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"}, 23 | {token: "aggregate", regex: "aggregate", next: "aggregate"}, 24 | {token: "rolling", regex: "rolling", next: "rolling"}, 25 | {token: "resample", regex: "resample", next: "resample"}, 26 | {token: "text", regex: "\\s+"}, 27 | {token: math, regex: "\\b\\w+\\b"}, 28 | ], 29 | "metric": [ 30 | {token : "metric.name", regex: "\\b[^\\s]+\\b", next: "aggregator"}, 31 | // TODO(sileht): allow quoted metric 32 | ], 33 | "aggregator": [ 34 | {token : "metric.aggregator", regex: "\\b[^\\s]+\\b", next: "start"}, 35 | ], 36 | "aggregate": [ 37 | {token : aggregators, regex: "\\b\\w+\\b", next: "start"}, 38 | ], 39 | "rolling": [ 40 | {token : aggregators, regex: "\\b\\w+\\b", next: "rollingwindow"}, 41 | ], 42 | "rollingwindow": [ 43 | {token : "rolling.window", regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b", next: "start"}, 44 | {token : "invalid.illegal.rollingwindow", regex: "\\b\\w+\\b"}, 45 | ], 46 | "resample": [ 47 | {token : aggregators, regex: "\\b\\w+\\b", next: "resamplegranularity"}, 48 | ], 49 | "resamplegranularity": [ 50 | {token : "resample.granularity", regex: "\\d+\\w?\\b", next: "start"}, 51 | {token : "invalid.illegal.granularity", regex: "\\b\\w+\\b"}, 52 | ], 53 | 54 | }; 55 | this.normalizeRules(); 56 | }; 57 | 58 | oop.inherits(GnocchiOperationsHighlightRules, TextHighlightRules); 59 | 60 | exports.GnocchiOperationsHighlightRules = GnocchiOperationsHighlightRules; 61 | }); 62 | 63 | ace.define("ace/mode/gnocchioperations_completions",["require","exports","module","ace/token_iterator", "ace/lib/lang"], function(require, exports, module) { 64 | "use strict"; 65 | 66 | var lang = require("../lib/lang"); 67 | var GnocchiOperationsCompletions = function() {}; 68 | 69 | (function() { 70 | this.getCompletions = function(state, session, pos, prefix, callback) { 71 | // dummy completer to avoid unwanted keyword/local completion 72 | return callback(null, []); 73 | }; 74 | 75 | }).call(GnocchiOperationsCompletions.prototype); 76 | 77 | exports.GnocchiOperationsCompletions = GnocchiOperationsCompletions; 78 | }); 79 | 80 | 81 | ace.define("ace/mode/gnocchioperations",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/gnocchioperations_highlight_rules"], function(require, exports, module) { 82 | "use strict"; 83 | 84 | var oop = require("../lib/oop"); 85 | var TextMode = require("./text").Mode; 86 | var GnocchiOperationsHighlightRules = require("./gnocchioperations_highlight_rules").GnocchiOperationsHighlightRules; 87 | var GnocchiOperationsCompletions = require("./gnocchioperations_completions").GnocchiOperationsCompletions; 88 | 89 | var Mode = function() { 90 | this.HighlightRules = GnocchiOperationsHighlightRules; 91 | this.$behaviour = this.$defaultBehaviour; 92 | this.$completer = new GnocchiOperationsCompletions(); 93 | this.completer = this.$completer; 94 | }; 95 | oop.inherits(Mode, TextMode); 96 | 97 | (function() { 98 | 99 | this.$id = "ace/mode/gnocchioperations"; 100 | }).call(Mode.prototype); 101 | 102 | exports.Mode = Mode; 103 | 104 | }); 105 | -------------------------------------------------------------------------------- /src/mode-gnocchioperations.js: -------------------------------------------------------------------------------- 1 | // jshint ignore: start 2 | // jscs: disable 3 | ace.define("ace/mode/gnocchioperations_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { 4 | "use strict"; 5 | 6 | var oop = require("../lib/oop"); 7 | var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; 8 | 9 | var GnocchiOperationsHighlightRules = function() { 10 | var aggregators = this.createKeywordMapper({ 11 | "aggregator": "mean|median|std|min|max|sum|var|count", 12 | }, "invalid.illegal.aggregator", true); 13 | 14 | var math = this.createKeywordMapper({ 15 | "math": "+|add|%|mod|-|sub|\\*|×|mul|/|÷|div|\\*\\*|pow|^|cos|sin|abs|cos|sin|tan|floor|ceil|neg|rateofchange", 16 | }, "invalid.illegal.operation", true); 17 | 18 | // TODO(sileht): prefix token by ace known name for better color 19 | this.$rules = { 20 | "start": [ 21 | {token: "metric.start", regex: "metric", next: "metric"}, 22 | {token: "constant.numeric", regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"}, 23 | {token: "aggregate", regex: "aggregate", next: "aggregate"}, 24 | {token: "rolling", regex: "rolling", next: "rolling"}, 25 | {token: "resample", regex: "resample", next: "resample"}, 26 | {token: "text", regex: "\\s+"}, 27 | {token: math, regex: "\\b\\w+\\b"}, 28 | ], 29 | "metric": [ 30 | {token : "metric.name", regex: "\\b[^\\s]+\\b", next: "aggregator"}, 31 | // TODO(sileht): allow quoted metric 32 | ], 33 | "aggregator": [ 34 | {token : "metric.aggregator", regex: "\\b[^\\s]+\\b", next: "start"}, 35 | ], 36 | "aggregate": [ 37 | {token : aggregators, regex: "\\b\\w+\\b", next: "start"}, 38 | ], 39 | "rolling": [ 40 | {token : aggregators, regex: "\\b\\w+\\b", next: "rollingwindow"}, 41 | ], 42 | "rollingwindow": [ 43 | {token : "rolling.window", regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b", next: "start"}, 44 | {token : "invalid.illegal.rollingwindow", regex: "\\b\\w+\\b"}, 45 | ], 46 | "resample": [ 47 | {token : aggregators, regex: "\\b\\w+\\b", next: "resamplegranularity"}, 48 | ], 49 | "resamplegranularity": [ 50 | {token : "resample.granularity", regex: "\\d+\\w?\\b", next: "start"}, 51 | {token : "invalid.illegal.granularity", regex: "\\b\\w+\\b"}, 52 | ], 53 | 54 | }; 55 | this.normalizeRules(); 56 | }; 57 | 58 | oop.inherits(GnocchiOperationsHighlightRules, TextHighlightRules); 59 | 60 | exports.GnocchiOperationsHighlightRules = GnocchiOperationsHighlightRules; 61 | }); 62 | 63 | ace.define("ace/mode/gnocchioperations_completions",["require","exports","module","ace/token_iterator", "ace/lib/lang"], function(require, exports, module) { 64 | "use strict"; 65 | 66 | var lang = require("../lib/lang"); 67 | var GnocchiOperationsCompletions = function() {}; 68 | 69 | (function() { 70 | this.getCompletions = function(state, session, pos, prefix, callback) { 71 | // dummy completer to avoid unwanted keyword/local completion 72 | return callback(null, []); 73 | }; 74 | 75 | }).call(GnocchiOperationsCompletions.prototype); 76 | 77 | exports.GnocchiOperationsCompletions = GnocchiOperationsCompletions; 78 | }); 79 | 80 | 81 | ace.define("ace/mode/gnocchioperations",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/gnocchioperations_highlight_rules"], function(require, exports, module) { 82 | "use strict"; 83 | 84 | var oop = require("../lib/oop"); 85 | var TextMode = require("./text").Mode; 86 | var GnocchiOperationsHighlightRules = require("./gnocchioperations_highlight_rules").GnocchiOperationsHighlightRules; 87 | var GnocchiOperationsCompletions = require("./gnocchioperations_completions").GnocchiOperationsCompletions; 88 | 89 | var Mode = function() { 90 | this.HighlightRules = GnocchiOperationsHighlightRules; 91 | this.$behaviour = this.$defaultBehaviour; 92 | this.$completer = new GnocchiOperationsCompletions(); 93 | this.completer = this.$completer; 94 | }; 95 | oop.inherits(Mode, TextMode); 96 | 97 | (function() { 98 | 99 | this.$id = "ace/mode/gnocchioperations"; 100 | }).call(Mode.prototype); 101 | 102 | exports.Mode = Mode; 103 | 104 | }); 105 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Grafana Gnocchi datasource [![Travis CI](https://travis-ci.org/gnocchixyz/grafana-gnocchi-datasource.png?branch=master)](https://travis-ci.org/gnocchixyz/grafana-gnocchi-datasource) 2 | 3 | Gnocchi datasource for Grafana >= 4 4 | 5 | ![](https://raw.githubusercontent.com/gnocchixyz/grafana-gnocchi-datasource/master/docs/collectd-dashboard.png) 6 | 7 | ## Installation via grafana.net 8 | 9 | $ sudo grafana-cli plugins install gnocchixyz-gnocchi-datasource 10 | 11 | 12 | ## Installation from sources 13 | 14 | $ npm install 15 | $ ./run-tests.sh # This also build the plugin under dist/ 16 | 17 | $ ln -s dist /var/lib/grafana/plugins/grafana-gnocchi-datasource 18 | $ # or 19 | $ cp -a dist /var/lib/grafana/plugins/grafana-gnocchi-datasource 20 | 21 | 22 | ## Configuration Panel 23 | 24 | ![](https://raw.githubusercontent.com/gnocchixyz/grafana-gnocchi-datasource/master/docs/add_datasource_gnocchi.png) 25 | 26 | Name | Description 27 | ------------ | ------------- 28 | Name | The data source name. 29 | Default | Default data source means that it will be pre-selected for new panels. 30 | Url | The http protocol, ip and port of your Keystone or Gnocchi server (default port is usually 8080) 31 | Access | Proxy = access via Grafana backend, Direct = access directory from browser. 32 | Token | A valid Keystone token 33 | Project | The keystone user 34 | User | The Keystone user 35 | Password | The Keystone password 36 | 37 | Note: If the Keystone server is set as URL, the Gnocchi server will be autodiscovered. 38 | This works only if Access = Direct, and CORS is properly configured on Keystone and Gnocchi side. 39 | 40 | ## Query editor 41 | 42 | The editor leverage thes Dynamic Aggregate API of Gnocchi: 43 | 44 | * Select first the *resource type* you are looking for. 45 | * Create a *query* to select all resources you need. 46 | * Create an *operation* that selects metric and does math on/between them. 47 | * Set *label* to name each graph with text or with resource attributes. 48 | 49 | The `Query` format is documented as STRING format in *Resource search* section of [Gnocchi documentations](http://gnocchi.xyz/rest.html#search). 50 | The `Operation` format is documented in *Dynamic Aggregates* section of [Gnocchi documentations](https://gnocchi.xyz/rest.html#list-of-supported-operations). 51 | 52 | ![](https://raw.githubusercontent.com/gnocchixyz/grafana-gnocchi-datasource/master/docs/grafana-dynamic.png) 53 | 54 | Other *Query type* exists for special use case and for old Gnocchi version that doesn't support *Dynamic aggregates* 55 | 56 | ## Labels 57 | 58 | Labels can be expressed with resources attributes and metric name. To do so attribute must be surrounded by ${} or prefixed by $. 59 | 60 | For example, takes the metric regex "cpu_*", the label 61 | "$display_name-${host}.foo-$type $metric" and a query that returns these 62 | resources:: 63 | 64 | [ 65 | { 66 | "display_name": "myfirstvm", 67 | "host": "compute1", 68 | "id": "6868da77-fa82-4e67-aba9-270c5ae8cbca", 69 | "image_ref": "http://image", 70 | "type": "instance", 71 | "server_group": "autoscalig_group", 72 | "metrics": {"cpu_util": "1634173a-e3b8-4119-9eba-fa9a4d971c3b"} 73 | }, 74 | { 75 | "display_name": "mysecondvm", 76 | "host": "compute3", 77 | "id": "f898ba55-bbea-460f-985c-3d1243348304", 78 | "image_ref": "http://image", 79 | "type": "instance", 80 | "server_group": "autoscalig_group", 81 | "metrics": {"cpu_util": "58b233f4-65ba-4aeb-97ba-b8bc0feec97e", 82 | "cpu_time": "6ff95458-97b4-4b08-af03-7d18b05d277e"} 83 | } 84 | ] 85 | 86 | The resulting labels are:: 87 | 88 | myfirstvm-compute1.foo-instance cpu_util 89 | mysecondvm-compute3.foo-instance cpu_util 90 | mysecondvm-compute3.foo-instance cpu_time 91 | 92 | ## Templated queries 93 | 94 | Gnocchi Datasource Plugin provides following functions in `Variables values query` field in Templating Editor. 95 | 96 | Name | Description 97 | | ------- | --------| 98 | `metrics(resource_id)` | Returns a list of metrics available for the resource identified by ‘resource_id’ 99 | `resources(resource_type, `attribute`, query)` | Returns a list of resource `attribute` matching `query`. 100 | `resources(resource_type, `attribute1`, `attribute2`, query)` | Returns a list of resource `attribute` matching `query`, `attribute1` is diplayed in selector, `attribute1` used for templating. 101 | 102 | ![](https://raw.githubusercontent.com/gnocchixyz/grafana-gnocchi-datasource/master/docs/gnocchi_templating.png) 103 | 104 | For details of `Query` format, please refer to the Gnocchi and Gnocchi client documentations. 105 | 106 | - [Search for resource - Gnocchi client Documentation](http://gnocchi.xyz/gnocchiclient/shell.html#gnocchi-resource-search) for expression format 107 | - [Search for resource - Gnocchi Documentation](http://gnocchi.xyz/rest.html#searching-for-resources) for the raw json format. 108 | 109 | ## Current Limitation 110 | 111 | Grafana doesn’t allow to query two different servers when using the proxy mode, 112 | so we are not able to query Keystone for a token and then query Gnocchi (Except if 113 | Gnocchi and Keystone live into the same HTTP host). 114 | 115 | In direct mode, CORS MUST be enabled on Keystone and Gnocchi servers. 116 | 117 | ## License 118 | 119 | APACHE LICENSE Version 2.0, January 2004 120 | -------------------------------------------------------------------------------- /dist/README.md: -------------------------------------------------------------------------------- 1 | # Grafana Gnocchi datasource [![Travis CI](https://travis-ci.org/gnocchixyz/grafana-gnocchi-datasource.png?branch=master)](https://travis-ci.org/gnocchixyz/grafana-gnocchi-datasource) 2 | 3 | Gnocchi datasource for Grafana >= 4 4 | 5 | ![](https://raw.githubusercontent.com/gnocchixyz/grafana-gnocchi-datasource/master/docs/collectd-dashboard.png) 6 | 7 | ## Installation via grafana.net 8 | 9 | $ sudo grafana-cli plugins install gnocchixyz-gnocchi-datasource 10 | 11 | 12 | ## Installation from sources 13 | 14 | $ npm install 15 | $ ./run-tests.sh # This also build the plugin under dist/ 16 | 17 | $ ln -s dist /var/lib/grafana/plugins/grafana-gnocchi-datasource 18 | $ # or 19 | $ cp -a dist /var/lib/grafana/plugins/grafana-gnocchi-datasource 20 | 21 | 22 | ## Configuration Panel 23 | 24 | ![](https://raw.githubusercontent.com/gnocchixyz/grafana-gnocchi-datasource/master/docs/add_datasource_gnocchi.png) 25 | 26 | Name | Description 27 | ------------ | ------------- 28 | Name | The data source name. 29 | Default | Default data source means that it will be pre-selected for new panels. 30 | Url | The http protocol, ip and port of your Keystone or Gnocchi server (default port is usually 8080) 31 | Access | Proxy = access via Grafana backend, Direct = access directory from browser. 32 | Token | A valid Keystone token 33 | Project | The keystone user 34 | User | The Keystone user 35 | Password | The Keystone password 36 | 37 | Note: If the Keystone server is set as URL, the Gnocchi server will be autodiscovered. 38 | This works only if Access = Direct, and CORS is properly configured on Keystone and Gnocchi side. 39 | 40 | ## Query editor 41 | 42 | The editor leverage thes Dynamic Aggregate API of Gnocchi: 43 | 44 | * Select first the *resource type* you are looking for. 45 | * Create a *query* to select all resources you need. 46 | * Create an *operation* that selects metric and does math on/between them. 47 | * Set *label* to name each graph with text or with resource attributes. 48 | 49 | The `Query` format is documented as STRING format in *Resource search* section of [Gnocchi documentations](http://gnocchi.xyz/rest.html#search). 50 | The `Operation` format is documented in *Dynamic Aggregates* section of [Gnocchi documentations](https://gnocchi.xyz/rest.html#list-of-supported-operations). 51 | 52 | ![](https://raw.githubusercontent.com/gnocchixyz/grafana-gnocchi-datasource/master/docs/grafana-dynamic.png) 53 | 54 | Other *Query type* exists for special use case and for old Gnocchi version that doesn't support *Dynamic aggregates* 55 | 56 | ## Labels 57 | 58 | Labels can be expressed with resources attributes and metric name. To do so attribute must be surrounded by ${} or prefixed by $. 59 | 60 | For example, takes the metric regex "cpu_*", the label 61 | "$display_name-${host}.foo-$type $metric" and a query that returns these 62 | resources:: 63 | 64 | [ 65 | { 66 | "display_name": "myfirstvm", 67 | "host": "compute1", 68 | "id": "6868da77-fa82-4e67-aba9-270c5ae8cbca", 69 | "image_ref": "http://image", 70 | "type": "instance", 71 | "server_group": "autoscalig_group", 72 | "metrics": {"cpu_util": "1634173a-e3b8-4119-9eba-fa9a4d971c3b"} 73 | }, 74 | { 75 | "display_name": "mysecondvm", 76 | "host": "compute3", 77 | "id": "f898ba55-bbea-460f-985c-3d1243348304", 78 | "image_ref": "http://image", 79 | "type": "instance", 80 | "server_group": "autoscalig_group", 81 | "metrics": {"cpu_util": "58b233f4-65ba-4aeb-97ba-b8bc0feec97e", 82 | "cpu_time": "6ff95458-97b4-4b08-af03-7d18b05d277e"} 83 | } 84 | ] 85 | 86 | The resulting labels are:: 87 | 88 | myfirstvm-compute1.foo-instance cpu_util 89 | mysecondvm-compute3.foo-instance cpu_util 90 | mysecondvm-compute3.foo-instance cpu_time 91 | 92 | ## Templated queries 93 | 94 | Gnocchi Datasource Plugin provides following functions in `Variables values query` field in Templating Editor. 95 | 96 | Name | Description 97 | | ------- | --------| 98 | `metrics(resource_id)` | Returns a list of metrics available for the resource identified by ‘resource_id’ 99 | `resources(resource_type, `attribute`, query)` | Returns a list of resource `attribute` matching `query`. 100 | `resources(resource_type, `attribute1`, `attribute2`, query)` | Returns a list of resource `attribute` matching `query`, `attribute1` is diplayed in selector, `attribute1` used for templating. 101 | 102 | ![](https://raw.githubusercontent.com/gnocchixyz/grafana-gnocchi-datasource/master/docs/gnocchi_templating.png) 103 | 104 | For details of `Query` format, please refer to the Gnocchi and Gnocchi client documentations. 105 | 106 | - [Search for resource - Gnocchi client Documentation](http://gnocchi.xyz/gnocchiclient/shell.html#gnocchi-resource-search) for expression format 107 | - [Search for resource - Gnocchi Documentation](http://gnocchi.xyz/rest.html#searching-for-resources) for the raw json format. 108 | 109 | ## Current Limitation 110 | 111 | Grafana doesn’t allow to query two different servers when using the proxy mode, 112 | so we are not able to query Keystone for a token and then query Gnocchi (Except if 113 | Gnocchi and Keystone live into the same HTTP host). 114 | 115 | In direct mode, CORS MUST be enabled on Keystone and Gnocchi servers. 116 | 117 | ## License 118 | 119 | APACHE LICENSE Version 2.0, January 2004 120 | -------------------------------------------------------------------------------- /dist/completer.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"completer.js","sourceRoot":"","sources":["../src/completer.ts"],"names":[],"mappings":";;AAEA,0BAA4B;AAE5B;IAII,+BAAoB,IAAgC,EAAU,IAAY;QAAtD,SAAI,GAAJ,IAAI,CAA4B;QAAU,SAAI,GAAJ,IAAI,CAAQ;QACtE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC1B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;IACtC,CAAC;IAED,8CAAc,GAAd,UAAe,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ;QAArD,iBA6IC;QA5IG,IAAI,WAAW,GAAG,EAAE,CAAC;QACrB,IAAI,eAAe,CAAC;QACpB,IAAI,KAAK,GAAG,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;QAEpD,sBAAsB;QACtB,wGAAwG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,EAAE,IAAI;gBACX,IAAI,EAAE,IAAI;gBACV,KAAK,EAAE,MAAM,CAAC,SAAS;aAC1B,CAAC;QACN,CAAC,CAAC,CAAC;IACP,CAAC;IACL,4BAAC;AAAD,CAAC,AAtKD,IAsKC;AAtKY,sDAAqB"} -------------------------------------------------------------------------------- /src/partials/query.editor.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 | 5 |
6 | 7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | 16 |
17 | 18 |
19 |
20 |
21 | 22 | 23 |
24 |
25 | 26 | 27 |
28 |
29 | 30 |
31 | 32 |
33 | 34 |
35 |
36 |
37 |
38 | 39 | 40 |
41 |
42 | 43 | 47 |
48 |
49 | 50 | 51 | 52 |
53 |
54 | 55 |
56 | 57 |
58 |
59 |
60 | 61 | 62 |
63 |
64 |
65 |
66 |
67 | 68 |
69 |
70 | 71 | 72 |
73 |
74 | 75 | 76 |
77 |
78 | 79 | 80 |
81 |
82 | 83 | 84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 | 92 | 95 |
96 |
97 |
98 | -------------------------------------------------------------------------------- /dist/partials/query.editor.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 | 5 |
6 | 7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | 16 |
17 | 18 |
19 |
20 |
21 | 22 | 23 |
24 |
25 | 26 | 27 |
28 |
29 | 30 |
31 | 32 |
33 | 34 |
35 |
36 |
37 |
38 | 39 | 40 |
41 |
42 | 43 | 47 |
48 |
49 | 50 | 51 | 52 |
53 |
54 | 55 |
56 | 57 |
58 |
59 |
60 | 61 | 62 |
63 |
64 |
65 |
66 |
67 | 68 |
69 |
70 | 71 | 72 |
73 |
74 | 75 | 76 |
77 |
78 | 79 | 80 |
81 |
82 | 83 | 84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 | 92 | 95 |
96 |
97 |
98 | -------------------------------------------------------------------------------- /src/completer.ts: -------------------------------------------------------------------------------- 1 | import { GnocchiDatasource } from './datasource'; 2 | import { GnocchiDatasourceQueryCtrl } from './query_ctrl'; 3 | import * as _ from "lodash"; 4 | 5 | export class GnocchiQueryCompleter { 6 | target: any; 7 | datasource: GnocchiDatasource; 8 | 9 | constructor(private ctrl: GnocchiDatasourceQueryCtrl, private mode: string) { 10 | this.target = ctrl.target; 11 | this.datasource = ctrl.datasource; 12 | } 13 | 14 | getCompletions(editor, session, pos, prefix, callback){ 15 | var completions = []; 16 | var previous_tokens; 17 | let token = session.getTokenAt(pos.row, pos.column); 18 | 19 | // console.log(token); 20 | // console.log(_.join(_.map(session.getTokens(0), (t: any) => {return t.type + "[" + t.value + "]";}))); 21 | 22 | var variables = _.map(this.ctrl.templateSrv.variables, (v: any) => { 23 | return ["[[" + v.name + "]]", "$" + v.name ]; // "${" + v.name + "}"]; not yet supported 24 | }); 25 | var operators = this.transformToCompletions( 26 | [">=", "<=", "!=", ">", "<", "=", "==", "eq", "ne", "lt", "gt", "ge", "le", 27 | "in", "like", "≠", "≥", "≤", "and", "or", "∧", "∨"], "operator"); 28 | var templates = this.transformToCompletions(_.flattenDeep(variables), "template variable"); 29 | 30 | if (this.mode === "operations") { 31 | 32 | var compl_type = token.type; 33 | previous_tokens = _.reverse(_.filter(session.getTokens(0), (t: any) => { return t.type !== "text"; })); 34 | if (previous_tokens[0] && compl_type === "text") { 35 | switch (previous_tokens[0].type) { 36 | case 'resample': 37 | case 'rolling': 38 | case 'aggregate': 39 | compl_type = "invalid.illegal.aggregator"; 40 | break; 41 | case 'metric.start': 42 | compl_type = "metric.name"; 43 | break; 44 | case 'metric.name': 45 | compl_type = "metric.aggregator"; 46 | break; 47 | case 'aggregator': 48 | switch (previous_tokens[1].type) { 49 | case "rolling": 50 | compl_type = "invalid.illegal.rollingwindow"; 51 | break; 52 | case "resample": 53 | compl_type = "invalid.illegal.granularity"; 54 | break; 55 | default: 56 | compl_type = "invalid.illegal.operation"; 57 | } 58 | break; 59 | default: 60 | compl_type = "invalid.illegal.operation"; 61 | } 62 | } 63 | 64 | if (compl_type === "metric.name") { 65 | this.ctrl.getCompletionsPromise("metrics").then((metrics) => { 66 | callback(null, this.transformToCompletions(metrics, "metrics")); 67 | }); 68 | } else if (compl_type === "metric.aggregator") { 69 | if (this.ctrl.cache) { 70 | var metric = session.getTokens(0)[token.index - 2].value; 71 | this.datasource.getCompletionsCacheForResource(this.ctrl.cache.resources, "^" + metric + "$").then((result) => { 72 | callback(null, this.transformToCompletions(result["aggregators"], "aggregator")); 73 | }); 74 | } 75 | } else if (compl_type === "invalid.illegal.granularity") { 76 | callback(null, this.transformToCompletions(["1m", "1h", "1d"], "granularity")); 77 | } else if (compl_type === "invalid.illegal.rollingwindow") { 78 | callback(null, this.transformToCompletions(["1", "2", "3", "5", "10", "100"], "window")); 79 | } else if (compl_type === "invalid.illegal.aggregator") { 80 | callback(null, this.transformToCompletions(["mean", "median", "std", "min", "max", "sum", "var", "count"], "aggregator")); 81 | } else if (compl_type === "invalid.illegal.operation") { 82 | var maths = _.concat(operators, this.transformToCompletions( 83 | ["+", "add", "%", "mod", "-", "sub", "\\*", "×", "mul", "/", "÷", "div", "**", "pow", "^", 84 | "cos", "sin", "abs", "cos", "sin", "tan", "floor", "ceil", "neg", "rateofchange"], 85 | "operation")); 86 | var aggregation = this.transformToCompletions(["aggregate", "resample", "rolling"], "aggregation"); 87 | var metrics = this.transformToCompletions(["metric"], "metric"); 88 | callback(null, _.concat(aggregation, maths, metrics)); 89 | } 90 | 91 | } else if (this.mode === "query") { 92 | 93 | var constants = this.transformToCompletions( 94 | ["None", "null", "none", "true", "false", "True", "False"], "constant"); 95 | 96 | if (token.type === "string") { 97 | previous_tokens = session.getTokens(0); 98 | var operator_found = false; 99 | for (var i = token.index; i >= 0; i--) { 100 | var t = previous_tokens[i]; 101 | if (t.type === "text" || token.index === t.index) { 102 | continue; 103 | } 104 | if (t.type === "keyword.operator.link") { 105 | // Don't go further, user puts a value before an identifier 106 | callback(null, completions); 107 | return; 108 | } else if (t.type === "keyword.operator.binary") { 109 | operator_found = true; 110 | } else if (t.type === "identifier" && operator_found) { 111 | this.datasource.getResourceTypes().then((resource_types) => { 112 | var i = _.findIndex(resource_types, (rt: any) => { return rt.name === this.target.resource_type; }); 113 | var valid_attrs = _.concat(this.datasource.GENERIC_ATTRIBUTES, _.keys(resource_types[i]['attributes'])); 114 | if (_.includes(valid_attrs, t.value)) { 115 | this.datasource.getCompletionsCacheForResourceAttributeValue( 116 | this.target.resource_type, t.value).then((values) => { 117 | var desc = this.target.resource_type + " " + t.value + " value"; 118 | callback(null, this.transformToCompletions(values, desc)); 119 | }); 120 | } 121 | }); 122 | return; 123 | } 124 | } 125 | } 126 | 127 | this.datasource.getResourceTypes().then((resource_types) => { 128 | var idx = _.findIndex(resource_types, (rt: any) => { return rt.name === this.target.resource_type; }); 129 | var generic_attributes = this.transformToCompletions(this.datasource.GENERIC_ATTRIBUTES, "generic attribute"); 130 | var rt_attributes = this.transformToCompletions(_.keys(resource_types[idx]['attributes']), 131 | this.target.resource_type + " attribute"); 132 | var completions = _.concat(generic_attributes, rt_attributes, operators, constants, templates); 133 | callback(null, completions); 134 | }); 135 | 136 | } else if (this.mode === "label") { 137 | 138 | this.datasource.getResourceTypes().then((resource_types) => { 139 | var i = _.findIndex(resource_types, (rt: any) => { return rt.name === this.target.resource_type; }); 140 | var special_attributes = this.transformToCompletions( 141 | _.map(["metric", "aggregator"], this.to_label_template), 142 | "special attribute"); 143 | var generic_attributes = this.transformToCompletions( 144 | _.map(this.datasource.GENERIC_ATTRIBUTES, this.to_label_template), 145 | "generic attribute"); 146 | var rt_attributes = this.transformToCompletions( 147 | _.map(_.keys(resource_types[i]['attributes']), this.to_label_template), 148 | this.target.resource_type + " attribute"); 149 | var completions = _.concat(templates, generic_attributes, rt_attributes, special_attributes); 150 | callback(null, completions); 151 | }); 152 | 153 | } 154 | return; 155 | } 156 | 157 | to_label_template(v: any) { 158 | return "${" + v + "}"; 159 | } 160 | 161 | transformToCompletions(words, meta) { 162 | return words.map(name => { 163 | return { 164 | caption: name, 165 | value: name, 166 | meta: meta, 167 | score: Number.MAX_VALUE, 168 | }; 169 | }); 170 | } 171 | } 172 | -------------------------------------------------------------------------------- /dist/completer.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | var _ = require("lodash"); 4 | var GnocchiQueryCompleter = /** @class */ (function () { 5 | function GnocchiQueryCompleter(ctrl, mode) { 6 | this.ctrl = ctrl; 7 | this.mode = mode; 8 | this.target = ctrl.target; 9 | this.datasource = ctrl.datasource; 10 | } 11 | GnocchiQueryCompleter.prototype.getCompletions = function (editor, session, pos, prefix, callback) { 12 | var _this = this; 13 | var completions = []; 14 | var previous_tokens; 15 | var token = session.getTokenAt(pos.row, pos.column); 16 | // console.log(token); 17 | // console.log(_.join(_.map(session.getTokens(0), (t: any) => {return t.type + "[" + t.value + "]";}))); 18 | var variables = _.map(this.ctrl.templateSrv.variables, function (v) { 19 | return ["[[" + v.name + "]]", "$" + v.name]; // "${" + v.name + "}"]; not yet supported 20 | }); 21 | var operators = this.transformToCompletions([">=", "<=", "!=", ">", "<", "=", "==", "eq", "ne", "lt", "gt", "ge", "le", 22 | "in", "like", "≠", "≥", "≤", "and", "or", "∧", "∨"], "operator"); 23 | var templates = this.transformToCompletions(_.flattenDeep(variables), "template variable"); 24 | if (this.mode === "operations") { 25 | var compl_type = token.type; 26 | previous_tokens = _.reverse(_.filter(session.getTokens(0), function (t) { return t.type !== "text"; })); 27 | if (previous_tokens[0] && compl_type === "text") { 28 | switch (previous_tokens[0].type) { 29 | case 'resample': 30 | case 'rolling': 31 | case 'aggregate': 32 | compl_type = "invalid.illegal.aggregator"; 33 | break; 34 | case 'metric.start': 35 | compl_type = "metric.name"; 36 | break; 37 | case 'metric.name': 38 | compl_type = "metric.aggregator"; 39 | break; 40 | case 'aggregator': 41 | switch (previous_tokens[1].type) { 42 | case "rolling": 43 | compl_type = "invalid.illegal.rollingwindow"; 44 | break; 45 | case "resample": 46 | compl_type = "invalid.illegal.granularity"; 47 | break; 48 | default: 49 | compl_type = "invalid.illegal.operation"; 50 | } 51 | break; 52 | default: 53 | compl_type = "invalid.illegal.operation"; 54 | } 55 | } 56 | if (compl_type === "metric.name") { 57 | this.ctrl.getCompletionsPromise("metrics").then(function (metrics) { 58 | callback(null, _this.transformToCompletions(metrics, "metrics")); 59 | }); 60 | } 61 | else if (compl_type === "metric.aggregator") { 62 | if (this.ctrl.cache) { 63 | var metric = session.getTokens(0)[token.index - 2].value; 64 | this.datasource.getCompletionsCacheForResource(this.ctrl.cache.resources, "^" + metric + "$").then(function (result) { 65 | callback(null, _this.transformToCompletions(result["aggregators"], "aggregator")); 66 | }); 67 | } 68 | } 69 | else if (compl_type === "invalid.illegal.granularity") { 70 | callback(null, this.transformToCompletions(["1m", "1h", "1d"], "granularity")); 71 | } 72 | else if (compl_type === "invalid.illegal.rollingwindow") { 73 | callback(null, this.transformToCompletions(["1", "2", "3", "5", "10", "100"], "window")); 74 | } 75 | else if (compl_type === "invalid.illegal.aggregator") { 76 | callback(null, this.transformToCompletions(["mean", "median", "std", "min", "max", "sum", "var", "count"], "aggregator")); 77 | } 78 | else if (compl_type === "invalid.illegal.operation") { 79 | var maths = _.concat(operators, this.transformToCompletions(["+", "add", "%", "mod", "-", "sub", "\\*", "×", "mul", "/", "÷", "div", "**", "pow", "^", 80 | "cos", "sin", "abs", "cos", "sin", "tan", "floor", "ceil", "neg", "rateofchange"], "operation")); 81 | var aggregation = this.transformToCompletions(["aggregate", "resample", "rolling"], "aggregation"); 82 | var metrics = this.transformToCompletions(["metric"], "metric"); 83 | callback(null, _.concat(aggregation, maths, metrics)); 84 | } 85 | } 86 | else if (this.mode === "query") { 87 | var constants = this.transformToCompletions(["None", "null", "none", "true", "false", "True", "False"], "constant"); 88 | if (token.type === "string") { 89 | previous_tokens = session.getTokens(0); 90 | var operator_found = false; 91 | for (var i = token.index; i >= 0; i--) { 92 | var t = previous_tokens[i]; 93 | if (t.type === "text" || token.index === t.index) { 94 | continue; 95 | } 96 | if (t.type === "keyword.operator.link") { 97 | // Don't go further, user puts a value before an identifier 98 | callback(null, completions); 99 | return; 100 | } 101 | else if (t.type === "keyword.operator.binary") { 102 | operator_found = true; 103 | } 104 | else if (t.type === "identifier" && operator_found) { 105 | this.datasource.getResourceTypes().then(function (resource_types) { 106 | var i = _.findIndex(resource_types, function (rt) { return rt.name === _this.target.resource_type; }); 107 | var valid_attrs = _.concat(_this.datasource.GENERIC_ATTRIBUTES, _.keys(resource_types[i]['attributes'])); 108 | if (_.includes(valid_attrs, t.value)) { 109 | _this.datasource.getCompletionsCacheForResourceAttributeValue(_this.target.resource_type, t.value).then(function (values) { 110 | var desc = _this.target.resource_type + " " + t.value + " value"; 111 | callback(null, _this.transformToCompletions(values, desc)); 112 | }); 113 | } 114 | }); 115 | return; 116 | } 117 | } 118 | } 119 | this.datasource.getResourceTypes().then(function (resource_types) { 120 | var idx = _.findIndex(resource_types, function (rt) { return rt.name === _this.target.resource_type; }); 121 | var generic_attributes = _this.transformToCompletions(_this.datasource.GENERIC_ATTRIBUTES, "generic attribute"); 122 | var rt_attributes = _this.transformToCompletions(_.keys(resource_types[idx]['attributes']), _this.target.resource_type + " attribute"); 123 | var completions = _.concat(generic_attributes, rt_attributes, operators, constants, templates); 124 | callback(null, completions); 125 | }); 126 | } 127 | else if (this.mode === "label") { 128 | this.datasource.getResourceTypes().then(function (resource_types) { 129 | var i = _.findIndex(resource_types, function (rt) { return rt.name === _this.target.resource_type; }); 130 | var special_attributes = _this.transformToCompletions(_.map(["metric", "aggregator"], _this.to_label_template), "special attribute"); 131 | var generic_attributes = _this.transformToCompletions(_.map(_this.datasource.GENERIC_ATTRIBUTES, _this.to_label_template), "generic attribute"); 132 | var rt_attributes = _this.transformToCompletions(_.map(_.keys(resource_types[i]['attributes']), _this.to_label_template), _this.target.resource_type + " attribute"); 133 | var completions = _.concat(templates, generic_attributes, rt_attributes, special_attributes); 134 | callback(null, completions); 135 | }); 136 | } 137 | return; 138 | }; 139 | GnocchiQueryCompleter.prototype.to_label_template = function (v) { 140 | return "${" + v + "}"; 141 | }; 142 | GnocchiQueryCompleter.prototype.transformToCompletions = function (words, meta) { 143 | return words.map(function (name) { 144 | return { 145 | caption: name, 146 | value: name, 147 | meta: meta, 148 | score: Number.MAX_VALUE, 149 | }; 150 | }); 151 | }; 152 | return GnocchiQueryCompleter; 153 | }()); 154 | exports.GnocchiQueryCompleter = GnocchiQueryCompleter; 155 | //# sourceMappingURL=completer.js.map -------------------------------------------------------------------------------- /src/query_ctrl.ts: -------------------------------------------------------------------------------- 1 | 2 | import * as _ from "lodash"; 3 | import * as angular from "angular"; 4 | 5 | import { GnocchiQueryCompleter } from './completer'; 6 | import './ace-loader'; 7 | 8 | export class GnocchiDatasourceQueryCtrl { 9 | static templateUrl = 'partials/query.editor.html'; 10 | 11 | // This is a copy of QueryCtrl interface 12 | target: any; 13 | oldTarget: any; 14 | datasource: any; 15 | panelCtrl: any; 16 | panel: any; 17 | hasRawMode: boolean; 18 | errors: string[]; 19 | isLastQuery: boolean; 20 | 21 | legacy_groupby_supported: boolean; 22 | 23 | // local stuffs 24 | aggregators: any; 25 | resource_types: any; 26 | queryModes: any; 27 | groupby_segments: any; 28 | 29 | last_valid_aggregator: string; 30 | last_valid_metric_name: string; 31 | 32 | cache: any; 33 | cache_promises: any; 34 | 35 | REMOVE_ME: string; 36 | SET_ME: string; 37 | 38 | constructor(public $scope, private $injector, private $q, private uiSegmentSrv, public templateSrv) { 39 | this.isLastQuery = false; 40 | this.$scope = $scope; 41 | this.panel = this.panelCtrl.panel; 42 | 43 | this.REMOVE_ME = "- remove me -"; 44 | this.SET_ME = "- set me -"; 45 | 46 | this.cache = null; 47 | this.cache_promises = []; 48 | this.errors = []; 49 | 50 | this.queryModes = [ 51 | {text: 'resource search', value: 'resource_search'}, 52 | {text: 'resource search (aggregated measurements)', value: 'resource_aggregation'}, 53 | {text: 'resource ID and metric name (deprecated)', value: 'resource'}, 54 | {text: 'metric ID', value: 'metric'} 55 | ]; 56 | 57 | this.legacy_groupby_supported = false; 58 | 59 | this.datasource.requireVersion("4.1.1").then(() => { 60 | this.queryModes.splice(0, 0, 61 | {text: 'dynamic aggregates (Recommended)', value: 'dynamic_aggregates'} 62 | ); 63 | }); 64 | this.datasource.requireVersion("4.3").then(() => { 65 | this.legacy_groupby_supported = true; 66 | }); 67 | 68 | this.datasource.getResourceTypes().then((results) => { 69 | this.resource_types = ["generic"]; 70 | _.map(results, (item) => { 71 | if (item["name"] !== "generic") { 72 | this.resource_types.push(item["name"]); 73 | } 74 | }); 75 | }); 76 | 77 | if (!this.target.refId) { 78 | this.target.refId = this.getNextQueryLetter(); 79 | } 80 | 81 | if (!this.target.queryMode) { 82 | this.target.queryMode = "resource_search"; 83 | } 84 | 85 | // default 86 | if (!this.target.resource_type) { 87 | this.target.resource_type = 'generic'; 88 | } 89 | if (!this.target.metric_name) { 90 | this.target.metric_name = this.datasource.NOT_FOUND; 91 | } 92 | 93 | if (!this.target.resource_search) { 94 | this.target.resource_search = ''; 95 | } 96 | if (!this.target.groupby) { 97 | this.target.groupby = ''; 98 | } 99 | if (!this.target.label) { 100 | this.target.label = ''; 101 | } 102 | if (!this.target.operations) { 103 | this.target.operations = ''; 104 | } 105 | if (!this.target.reaggregator) { 106 | this.target.reaggregator = 'none'; 107 | } 108 | 109 | if (this.target.draw_missing_datapoint_as_zero === undefined) { 110 | this.target.draw_missing_datapoint_as_zero = true; 111 | } 112 | if (this.target.fill === undefined && this.target.draw_missing_datapoint_as_zero) { 113 | // backward compat. 114 | this.target.fill = 0; 115 | } 116 | if (!this.target.needed_overlap) { 117 | this.target.needed_overlap = 0; 118 | } 119 | 120 | this.groupby_segments = _.uniq(_.remove(this.target.groupby.split(','), (item) => { return item !== ""; })); 121 | 122 | this.refresh_query(); 123 | } 124 | 125 | getCompletionsPromise(t) { 126 | var deferred = this.$q.defer(); 127 | if (this.cache) { 128 | deferred.resolve(this.cache[t]); 129 | } else { 130 | this.cache_promises.push([t, deferred]); 131 | this.refresh_query(); 132 | } 133 | return deferred.promise; 134 | } 135 | 136 | getCompletions(t) { 137 | var p = this.getCompletionsPromise(t); 138 | return p.then((result) => { 139 | if (t === "metrics") { 140 | return _.map(result, (m) => {return {text: m, name: m};}); 141 | } else { 142 | return result; 143 | } 144 | }).then(this.uiSegmentSrv.transformToSegments(false)); 145 | } 146 | 147 | getCompleter(mode) { 148 | return new GnocchiQueryCompleter(this, mode); 149 | } 150 | 151 | getReaggregators() { 152 | var agg = ['none', 'mean', 'sum', 'min', 'max', 153 | 'std', 'median', 'first', 'last', 'count', 'rate:last', 154 | '5pct', '10pct', '90pct', '95pct']; 155 | return _.map(agg, function(v) { 156 | return {text: v, value: v}; 157 | }); 158 | } 159 | 160 | setReaggregator(option) { 161 | if (option !== undefined) { 162 | this.target.reaggregator = option.value; 163 | } 164 | this.refresh(); 165 | } 166 | 167 | getGroupBy(index) { 168 | return this.datasource.getResourceTypes().then((resource_types) => { 169 | var i = _.findIndex(resource_types, (rt: any) => { 170 | return rt.name === this.target.resource_type; 171 | }); 172 | var attributes = _.difference( 173 | _.concat(this.datasource.GENERIC_ATTRIBUTES, 174 | _.keys(resource_types[i]['attributes'])), 175 | _.without(this.groupby_segments, this.groupby_segments[index]) 176 | ); 177 | attributes.sort(); 178 | attributes.unshift(this.REMOVE_ME); 179 | return _.map(attributes, (attr) => { 180 | return {text: attr, value: attr}; 181 | }); 182 | }).then(this.uiSegmentSrv.transformToSegments(false)); 183 | } 184 | 185 | addGroupBy() { 186 | if (!_.includes(this.groupby_segments, this.SET_ME)) { 187 | this.groupby_segments.push(this.SET_ME); 188 | } 189 | } 190 | 191 | setGroupBy(index, option) { 192 | if (option === undefined || _.trim(option.value) === "" || option.value === this.REMOVE_ME) { 193 | this.groupby_segments.splice(index, 1); 194 | } else { 195 | this.groupby_segments[index] = option.value; 196 | } 197 | this.target.groupby = _.without(this.groupby_segments, this.SET_ME).join(","); 198 | this.refresh(); 199 | } 200 | 201 | refresh_query() { 202 | if (_.isEqual(this.oldTarget, this.target)) { 203 | return ; 204 | } 205 | this.datasource.getCompletionsCache(this.target, null).then((cache) => { 206 | this.cache = cache; 207 | this.refresh(); 208 | }); 209 | } 210 | 211 | refresh_metric(option) { 212 | if (_.isEqual(this.oldTarget, this.target)) { 213 | return ; 214 | } 215 | this.target.ready_metric = false; 216 | this.datasource.getCompletionsCache(this.target, this.cache['resources']).then((cache) => { 217 | this.cache = cache; 218 | this.refresh(); 219 | }); 220 | } 221 | 222 | refresh(){ 223 | _.forEach(this.cache_promises, (p) => { 224 | p[1].resolve(this.cache[p[0]]); 225 | }); 226 | this.cache_promises = []; 227 | 228 | if (!_.isEqual(this.oldTarget, this.target)) { 229 | 230 | if (this.target.queryMode !== "dynamic_aggregates") { 231 | // Ensure we have a valid aggregator 232 | if (!_.includes(this.cache["aggregators"], this.target.aggregator)) { 233 | if (_.includes(this.cache["aggregators"], this.last_valid_aggregator)) { 234 | this.target.aggregator = this.last_valid_aggregator; 235 | } else { 236 | this.target.aggregator = this.cache["aggregators"][0]; 237 | } 238 | } else { 239 | this.last_valid_aggregator = this.target.aggregator; 240 | } 241 | } 242 | 243 | this.oldTarget = angular.copy(this.target); 244 | 245 | this.ValidateTarget(); 246 | if (this.errors.length === 0) { 247 | this.panelCtrl.refresh(); 248 | } 249 | } 250 | } 251 | 252 | ValidateTarget(){ 253 | this.errors = []; 254 | switch (this.target.queryMode) { 255 | case "metric": 256 | if (!this.target.metric_id) { 257 | this.errors.push("metric_id"); 258 | } 259 | break; 260 | case "resource": 261 | if (!this.target.resource_id) { 262 | this.errors.push("resource_id"); 263 | } 264 | if (!this.target.metric_name) { 265 | this.errors.push("metric_name"); 266 | } 267 | if (!this.target.aggregator || this.target.aggregator === this.datasource.NOT_FOUND) { 268 | this.errors.push("aggregator"); 269 | } 270 | break; 271 | case "dynamic_aggregates": 272 | if (!this.target.resource_search || !this.cache || !this.cache.metrics) { 273 | this.errors.push("query"); 274 | } 275 | if (!this.target.operations) { 276 | this.errors.push("operations"); 277 | } 278 | break; 279 | case "resource_aggregation": 280 | case "resource_search": 281 | if (!this.target.resource_search || !this.cache || !this.cache.metrics) { 282 | this.errors.push("query"); 283 | } 284 | if (!this.target.metric_name || this.target.metric_name === this.datasource.NOT_FOUND) { 285 | this.errors.push("metric_name"); 286 | } 287 | if (!this.target.aggregator || this.target.aggregator === this.datasource.NOT_FOUND) { 288 | this.errors.push("aggregator"); 289 | } 290 | break; 291 | default: 292 | break; 293 | } 294 | 295 | } 296 | 297 | // QueryCTRL stuffs 298 | getNextQueryLetter() { 299 | var letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; 300 | 301 | return _.find(letters, refId => { 302 | return _.every(this.panel.targets, function(other: any) { 303 | return other.refId !== refId; 304 | }); 305 | }); 306 | } 307 | } 308 | -------------------------------------------------------------------------------- /dist/query_ctrl.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"query_ctrl.js","sourceRoot":"","sources":["../src/query_ctrl.ts"],"names":[],"mappings":";;AACA,0BAA4B;AAC5B,iCAAmC;AAEnC,yCAAoD;AACpD,wBAAsB;AAEtB;IA8BE,oCAAmB,MAAM,EAAU,SAAS,EAAU,EAAE,EAAU,YAAY,EAAS,WAAW;QAAlG,iBAqFC;QArFkB,WAAM,GAAN,MAAM,CAAA;QAAU,cAAS,GAAT,SAAS,CAAA;QAAU,OAAE,GAAF,EAAE,CAAA;QAAU,iBAAY,GAAZ,YAAY,CAAA;QAAS,gBAAW,GAAX,WAAW,CAAA;QAChG,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;QAElC,IAAI,CAAC,SAAS,GAAG,eAAe,CAAC;QACjC,IAAI,CAAC,MAAM,GAAG,YAAY,CAAC;QAE3B,IAAI,CAAC,K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AAI,CAAC,aAAa,CAAC,CAAC;gBAClC,CAAC;gBACD,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,IAAI,IAAI,CAAC,MAAM,CAAC,UAAU,KAAK,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC;oBACpF,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;gBACjC,CAAC;gBACD,KAAK,CAAC;YACR;gBACE,KAAK,CAAC;QACV,CAAC;IAEL,CAAC;IAED,mBAAmB;IACnB,uDAAkB,GAAlB;QAAA,iBAQC;QAPC,IAAI,OAAO,GAAG,4BAA4B,CAAC;QAE3C,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,UAAA,KAAK;YAC1B,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,KAAI,CAAC,KAAK,CAAC,OAAO,EAAE,UAAS,KAAU;gBACpD,MAAM,CAAC,KAAK,CAAC,KAAK,KAAK,KAAK,CAAC;YAC/B,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAzSM,sCAAW,GAAG,4BAA4B,CAAC;IA0SpD,iCAAC;CAAA,AA3SD,IA2SC;AA3SY,gEAA0B"} -------------------------------------------------------------------------------- /dist/query_ctrl.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | var _ = require("lodash"); 4 | var angular = require("angular"); 5 | var completer_1 = require("./completer"); 6 | require("./ace-loader"); 7 | var GnocchiDatasourceQueryCtrl = /** @class */ (function () { 8 | function GnocchiDatasourceQueryCtrl($scope, $injector, $q, uiSegmentSrv, templateSrv) { 9 | var _this = this; 10 | this.$scope = $scope; 11 | this.$injector = $injector; 12 | this.$q = $q; 13 | this.uiSegmentSrv = uiSegmentSrv; 14 | this.templateSrv = templateSrv; 15 | this.isLastQuery = false; 16 | this.$scope = $scope; 17 | this.panel = this.panelCtrl.panel; 18 | this.REMOVE_ME = "- remove me -"; 19 | this.SET_ME = "- set me -"; 20 | this.cache = null; 21 | this.cache_promises = []; 22 | this.errors = []; 23 | this.queryModes = [ 24 | { text: 'resource search', value: 'resource_search' }, 25 | { text: 'resource search (aggregated measurements)', value: 'resource_aggregation' }, 26 | { text: 'resource ID and metric name (deprecated)', value: 'resource' }, 27 | { text: 'metric ID', value: 'metric' } 28 | ]; 29 | this.legacy_groupby_supported = false; 30 | this.datasource.requireVersion("4.1.1").then(function () { 31 | _this.queryModes.splice(0, 0, { text: 'dynamic aggregates (Recommended)', value: 'dynamic_aggregates' }); 32 | }); 33 | this.datasource.requireVersion("4.3").then(function () { 34 | _this.legacy_groupby_supported = true; 35 | }); 36 | this.datasource.getResourceTypes().then(function (results) { 37 | _this.resource_types = ["generic"]; 38 | _.map(results, function (item) { 39 | if (item["name"] !== "generic") { 40 | _this.resource_types.push(item["name"]); 41 | } 42 | }); 43 | }); 44 | if (!this.target.refId) { 45 | this.target.refId = this.getNextQueryLetter(); 46 | } 47 | if (!this.target.queryMode) { 48 | this.target.queryMode = "resource_search"; 49 | } 50 | // default 51 | if (!this.target.resource_type) { 52 | this.target.resource_type = 'generic'; 53 | } 54 | if (!this.target.metric_name) { 55 | this.target.metric_name = this.datasource.NOT_FOUND; 56 | } 57 | if (!this.target.resource_search) { 58 | this.target.resource_search = ''; 59 | } 60 | if (!this.target.groupby) { 61 | this.target.groupby = ''; 62 | } 63 | if (!this.target.label) { 64 | this.target.label = ''; 65 | } 66 | if (!this.target.operations) { 67 | this.target.operations = ''; 68 | } 69 | if (!this.target.reaggregator) { 70 | this.target.reaggregator = 'none'; 71 | } 72 | if (this.target.draw_missing_datapoint_as_zero === undefined) { 73 | this.target.draw_missing_datapoint_as_zero = true; 74 | } 75 | if (this.target.fill === undefined && this.target.draw_missing_datapoint_as_zero) { 76 | // backward compat. 77 | this.target.fill = 0; 78 | } 79 | if (!this.target.needed_overlap) { 80 | this.target.needed_overlap = 0; 81 | } 82 | this.groupby_segments = _.uniq(_.remove(this.target.groupby.split(','), function (item) { return item !== ""; })); 83 | this.refresh_query(); 84 | } 85 | GnocchiDatasourceQueryCtrl.prototype.getCompletionsPromise = function (t) { 86 | var deferred = this.$q.defer(); 87 | if (this.cache) { 88 | deferred.resolve(this.cache[t]); 89 | } 90 | else { 91 | this.cache_promises.push([t, deferred]); 92 | this.refresh_query(); 93 | } 94 | return deferred.promise; 95 | }; 96 | GnocchiDatasourceQueryCtrl.prototype.getCompletions = function (t) { 97 | var p = this.getCompletionsPromise(t); 98 | return p.then(function (result) { 99 | if (t === "metrics") { 100 | return _.map(result, function (m) { return { text: m, name: m }; }); 101 | } 102 | else { 103 | return result; 104 | } 105 | }).then(this.uiSegmentSrv.transformToSegments(false)); 106 | }; 107 | GnocchiDatasourceQueryCtrl.prototype.getCompleter = function (mode) { 108 | return new completer_1.GnocchiQueryCompleter(this, mode); 109 | }; 110 | GnocchiDatasourceQueryCtrl.prototype.getReaggregators = function () { 111 | var agg = ['none', 'mean', 'sum', 'min', 'max', 112 | 'std', 'median', 'first', 'last', 'count', 'rate:last', 113 | '5pct', '10pct', '90pct', '95pct']; 114 | return _.map(agg, function (v) { 115 | return { text: v, value: v }; 116 | }); 117 | }; 118 | GnocchiDatasourceQueryCtrl.prototype.setReaggregator = function (option) { 119 | if (option !== undefined) { 120 | this.target.reaggregator = option.value; 121 | } 122 | this.refresh(); 123 | }; 124 | GnocchiDatasourceQueryCtrl.prototype.getGroupBy = function (index) { 125 | var _this = this; 126 | return this.datasource.getResourceTypes().then(function (resource_types) { 127 | var i = _.findIndex(resource_types, function (rt) { 128 | return rt.name === _this.target.resource_type; 129 | }); 130 | var attributes = _.difference(_.concat(_this.datasource.GENERIC_ATTRIBUTES, _.keys(resource_types[i]['attributes'])), _.without(_this.groupby_segments, _this.groupby_segments[index])); 131 | attributes.sort(); 132 | attributes.unshift(_this.REMOVE_ME); 133 | return _.map(attributes, function (attr) { 134 | return { text: attr, value: attr }; 135 | }); 136 | }).then(this.uiSegmentSrv.transformToSegments(false)); 137 | }; 138 | GnocchiDatasourceQueryCtrl.prototype.addGroupBy = function () { 139 | if (!_.includes(this.groupby_segments, this.SET_ME)) { 140 | this.groupby_segments.push(this.SET_ME); 141 | } 142 | }; 143 | GnocchiDatasourceQueryCtrl.prototype.setGroupBy = function (index, option) { 144 | if (option === undefined || _.trim(option.value) === "" || option.value === this.REMOVE_ME) { 145 | this.groupby_segments.splice(index, 1); 146 | } 147 | else { 148 | this.groupby_segments[index] = option.value; 149 | } 150 | this.target.groupby = _.without(this.groupby_segments, this.SET_ME).join(","); 151 | this.refresh(); 152 | }; 153 | GnocchiDatasourceQueryCtrl.prototype.refresh_query = function () { 154 | var _this = this; 155 | if (_.isEqual(this.oldTarget, this.target)) { 156 | return; 157 | } 158 | this.datasource.getCompletionsCache(this.target, null).then(function (cache) { 159 | _this.cache = cache; 160 | _this.refresh(); 161 | }); 162 | }; 163 | GnocchiDatasourceQueryCtrl.prototype.refresh_metric = function (option) { 164 | var _this = this; 165 | if (_.isEqual(this.oldTarget, this.target)) { 166 | return; 167 | } 168 | this.target.ready_metric = false; 169 | this.datasource.getCompletionsCache(this.target, this.cache['resources']).then(function (cache) { 170 | _this.cache = cache; 171 | _this.refresh(); 172 | }); 173 | }; 174 | GnocchiDatasourceQueryCtrl.prototype.refresh = function () { 175 | var _this = this; 176 | _.forEach(this.cache_promises, function (p) { 177 | p[1].resolve(_this.cache[p[0]]); 178 | }); 179 | this.cache_promises = []; 180 | if (!_.isEqual(this.oldTarget, this.target)) { 181 | if (this.target.queryMode !== "dynamic_aggregates") { 182 | // Ensure we have a valid aggregator 183 | if (!_.includes(this.cache["aggregators"], this.target.aggregator)) { 184 | if (_.includes(this.cache["aggregators"], this.last_valid_aggregator)) { 185 | this.target.aggregator = this.last_valid_aggregator; 186 | } 187 | else { 188 | this.target.aggregator = this.cache["aggregators"][0]; 189 | } 190 | } 191 | else { 192 | this.last_valid_aggregator = this.target.aggregator; 193 | } 194 | } 195 | this.oldTarget = angular.copy(this.target); 196 | this.ValidateTarget(); 197 | if (this.errors.length === 0) { 198 | this.panelCtrl.refresh(); 199 | } 200 | } 201 | }; 202 | GnocchiDatasourceQueryCtrl.prototype.ValidateTarget = function () { 203 | this.errors = []; 204 | switch (this.target.queryMode) { 205 | case "metric": 206 | if (!this.target.metric_id) { 207 | this.errors.push("metric_id"); 208 | } 209 | break; 210 | case "resource": 211 | if (!this.target.resource_id) { 212 | this.errors.push("resource_id"); 213 | } 214 | if (!this.target.metric_name) { 215 | this.errors.push("metric_name"); 216 | } 217 | if (!this.target.aggregator || this.target.aggregator === this.datasource.NOT_FOUND) { 218 | this.errors.push("aggregator"); 219 | } 220 | break; 221 | case "dynamic_aggregates": 222 | if (!this.target.resource_search || !this.cache || !this.cache.metrics) { 223 | this.errors.push("query"); 224 | } 225 | if (!this.target.operations) { 226 | this.errors.push("operations"); 227 | } 228 | break; 229 | case "resource_aggregation": 230 | case "resource_search": 231 | if (!this.target.resource_search || !this.cache || !this.cache.metrics) { 232 | this.errors.push("query"); 233 | } 234 | if (!this.target.metric_name || this.target.metric_name === this.datasource.NOT_FOUND) { 235 | this.errors.push("metric_name"); 236 | } 237 | if (!this.target.aggregator || this.target.aggregator === this.datasource.NOT_FOUND) { 238 | this.errors.push("aggregator"); 239 | } 240 | break; 241 | default: 242 | break; 243 | } 244 | }; 245 | // QueryCTRL stuffs 246 | GnocchiDatasourceQueryCtrl.prototype.getNextQueryLetter = function () { 247 | var _this = this; 248 | var letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; 249 | return _.find(letters, function (refId) { 250 | return _.every(_this.panel.targets, function (other) { 251 | return other.refId !== refId; 252 | }); 253 | }); 254 | }; 255 | GnocchiDatasourceQueryCtrl.templateUrl = 'partials/query.editor.html'; 256 | return GnocchiDatasourceQueryCtrl; 257 | }()); 258 | exports.GnocchiDatasourceQueryCtrl = GnocchiDatasourceQueryCtrl; 259 | //# sourceMappingURL=query_ctrl.js.map -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright 2008-2012 Chris Davis; 2011-2015 The Graphite Project 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /dist/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright 2008-2012 Chris Davis; 2011-2015 The Graphite Project 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /dist/datasource.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"datasource.js","sourceRoot":"","sources":["../src/datasource.ts"],"names":[],"mappings":";;AAAA,0BAA4B;AAC5B,iCAA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