├── dist
├── css
│ └── query-editor.css
├── img
│ ├── annotations.png
│ └── timelion_logo.png
├── partials
│ ├── query.options.html
│ ├── config.html
│ ├── query.editor.html
│ └── annotations.editor.html
├── plugin.json
├── module.js.map
├── module.js
├── query_ctrl.js.map
├── README.md
├── query_ctrl.js
├── datasource.js
└── datasource.js.map
├── doc
├── logo.PNG
├── variables_1.PNG
├── variables_2.PNG
├── preview_ver1.png
└── repofunding_logo.png
├── src
├── css
│ └── query-editor.css
├── img
│ ├── annotations.png
│ └── timelion_logo.png
├── partials
│ ├── query.options.html
│ ├── config.html
│ ├── query.editor.html
│ └── annotations.editor.html
├── module.js
├── plugin.json
├── query_ctrl.js
└── datasource.js
├── CHANGES.MD
├── .gitignore
├── spec
├── test-main.js
└── datasource_spec.js
├── LICENSE
├── package.json
├── Gruntfile.js
└── README.md
/dist/css/query-editor.css:
--------------------------------------------------------------------------------
1 | .generic-datasource-query-row .query-keyword {
2 | width: 75px;
3 | }
--------------------------------------------------------------------------------
/doc/logo.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gbrian/grafana-timelion-datasource/HEAD/doc/logo.PNG
--------------------------------------------------------------------------------
/src/css/query-editor.css:
--------------------------------------------------------------------------------
1 | .generic-datasource-query-row .query-keyword {
2 | width: 75px;
3 | }
--------------------------------------------------------------------------------
/doc/variables_1.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gbrian/grafana-timelion-datasource/HEAD/doc/variables_1.PNG
--------------------------------------------------------------------------------
/doc/variables_2.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gbrian/grafana-timelion-datasource/HEAD/doc/variables_2.PNG
--------------------------------------------------------------------------------
/doc/preview_ver1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gbrian/grafana-timelion-datasource/HEAD/doc/preview_ver1.png
--------------------------------------------------------------------------------
/dist/img/annotations.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gbrian/grafana-timelion-datasource/HEAD/dist/img/annotations.png
--------------------------------------------------------------------------------
/doc/repofunding_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gbrian/grafana-timelion-datasource/HEAD/doc/repofunding_logo.png
--------------------------------------------------------------------------------
/src/img/annotations.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gbrian/grafana-timelion-datasource/HEAD/src/img/annotations.png
--------------------------------------------------------------------------------
/dist/img/timelion_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gbrian/grafana-timelion-datasource/HEAD/dist/img/timelion_logo.png
--------------------------------------------------------------------------------
/src/img/timelion_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gbrian/grafana-timelion-datasource/HEAD/src/img/timelion_logo.png
--------------------------------------------------------------------------------
/src/partials/query.options.html:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/dist/partials/query.options.html:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/CHANGES.MD:
--------------------------------------------------------------------------------
1 | ## Change list
2 |
3 | ### grafana 5.2.0
4 | PLUGIN
5 | #### 1.0.1
6 | * Fixed variables resolver and scopedVars for version 5.2.0
7 | * Added variables feature
--------------------------------------------------------------------------------
/dist/partials/config.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Extra settings
4 |
--------------------------------------------------------------------------------
/src/partials/config.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Extra settings
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | npm-debug.log
3 | coverage/
4 | .aws-config.json
5 | awsconfig
6 | /emails/dist
7 | /public_gen
8 | /tmp
9 | vendor/phantomjs/phantomjs
10 |
11 | docs/AWS_S3_BUCKET
12 | docs/GIT_BRANCH
13 | docs/VERSION
14 | docs/GITCOMMIT
15 | docs/changed-files
16 | docs/changed-files
17 |
18 | # locally required config files
19 | public/css/*.min.css
20 |
21 | # Editor junk
22 | *.sublime-workspace
23 | *.swp
24 | .idea/
25 | *.iml
26 |
27 | /data/*
28 | /bin/*
29 |
30 | conf/custom.ini
31 | fig.yml
32 | profile.cov
33 | grafana
34 | .notouch
35 |
36 | # Test artifacts
37 | /dist/test/
38 | .vscode/
39 | yarn.lock
40 | .jscs.json
41 |
--------------------------------------------------------------------------------
/spec/test-main.js:
--------------------------------------------------------------------------------
1 | import prunk from 'prunk';
2 | import {jsdom} from 'jsdom';
3 | import chai from 'chai';
4 |
5 | // Mock Grafana modules that are not available outside of the core project
6 | // Required for loading module.js
7 | prunk.mock('./css/query-editor.css!', 'no css, dude.');
8 | prunk.mock('app/plugins/sdk', {
9 | QueryCtrl: null
10 | });
11 |
12 | // Setup jsdom
13 | // Required for loading angularjs
14 | global.document = jsdom('');
15 | global.window = global.document.parentWindow;
16 |
17 | // Setup Chai
18 | chai.should();
19 | global.assert = chai.assert;
20 | global.expect = chai.expect;
21 |
--------------------------------------------------------------------------------
/src/module.js:
--------------------------------------------------------------------------------
1 | import {TimelionDatasource} from './datasource';
2 | import {TimelionDatasourceQueryCtrl} from './query_ctrl';
3 |
4 | class TimelionConfigCtrl {
5 | constructor($scope, datasourceSrv) {
6 | this.datasourceSrv = datasourceSrv;
7 | this.current.jsonData = this.current.jsonData || {};
8 | this.current.jsonData.esVersion = this.current.jsonData.esVersion || '5.3.0';
9 | }
10 | }
11 | TimelionConfigCtrl.templateUrl = 'partials/config.html';
12 |
13 | class GenericQueryOptionsCtrl {}
14 | GenericQueryOptionsCtrl.templateUrl = 'partials/query.options.html';
15 |
16 | class GenericAnnotationsQueryCtrl {}
17 | GenericAnnotationsQueryCtrl.templateUrl = 'partials/annotations.editor.html'
18 |
19 | export {
20 | TimelionDatasource as Datasource,
21 | TimelionDatasourceQueryCtrl as QueryCtrl,
22 | TimelionConfigCtrl as ConfigCtrl,
23 | GenericQueryOptionsCtrl as QueryOptionsCtrl,
24 | GenericAnnotationsQueryCtrl as AnnotationsQueryCtrl
25 | };
26 |
--------------------------------------------------------------------------------
/dist/partials/query.editor.html:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
15 |
16 |
17 |
19 |
20 |
--------------------------------------------------------------------------------
/src/partials/query.editor.html:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
15 |
16 |
17 |
19 |
20 |
--------------------------------------------------------------------------------
/src/plugin.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Timelion",
3 | "id": "grafana-timelion-datasource",
4 | "type": "datasource",
5 |
6 | "partials": {
7 | "config": "public/app/plugins/datasource/timelion/partials/config.html"
8 | },
9 |
10 | "metrics": true,
11 | "annotations": true,
12 |
13 | "info": {
14 | "description": "simple json datasource",
15 | "author": {
16 | "name": "Gustavo Brian Núñez Segade",
17 | "url": "https://github.com/gbrian"
18 | },
19 | "logos": {
20 | "small": "img/timelion_logo.png",
21 | "large": "img/timelion_logo.png"
22 | },
23 | "links": [
24 | {
25 | "name": "GitHub",
26 | "url": "https://github.com/gbrian/grafana-timelion-datasource"
27 | },
28 | {
29 | "name": "MIT License",
30 | "url": "https://github.com/gbrian/grafana-timelion-datasource/blob/master/LICENSE"
31 | }
32 | ],
33 | "version": "1.3.2",
34 | "updated": "2017-05-10"
35 | },
36 |
37 | "dependencies": {
38 | "grafanaVersion": "4.x.x",
39 | "plugins": []
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/dist/plugin.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Timelion",
3 | "id": "grafana-timelion-datasource",
4 | "type": "datasource",
5 |
6 | "partials": {
7 | "config": "public/app/plugins/datasource/timelion/partials/config.html"
8 | },
9 |
10 | "metrics": true,
11 | "annotations": true,
12 |
13 | "info": {
14 | "description": "simple json datasource",
15 | "author": {
16 | "name": "Gustavo Brian Núñez Segade",
17 | "url": "https://github.com/gbrian"
18 | },
19 | "logos": {
20 | "small": "img/timelion_logo.png",
21 | "large": "img/timelion_logo.png"
22 | },
23 | "links": [
24 | {
25 | "name": "GitHub",
26 | "url": "https://github.com/gbrian/grafana-timelion-datasource"
27 | },
28 | {
29 | "name": "MIT License",
30 | "url": "https://github.com/gbrian/grafana-timelion-datasource/blob/master/LICENSE"
31 | }
32 | ],
33 | "version": "1.3.2",
34 | "updated": "2017-05-10"
35 | },
36 |
37 | "dependencies": {
38 | "grafanaVersion": "4.x.x",
39 | "plugins": []
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 Grafana
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/src/query_ctrl.js:
--------------------------------------------------------------------------------
1 | import {QueryCtrl} from 'app/plugins/sdk';
2 | import './css/query-editor.css!'
3 |
4 | export class TimelionDatasourceQueryCtrl extends QueryCtrl {
5 |
6 | constructor($scope, $injector, uiSegmentSrv) {
7 | super($scope, $injector);
8 |
9 | this.scope = $scope;
10 | this.uiSegmentSrv = uiSegmentSrv;
11 | this.target.target = this.target.target || '.es(*)';
12 | this.target.type = this.target.type || 'timeserie';
13 | this.target.interval = this.target.interval || undefined;
14 | if(this.target.rawQuery === undefined)
15 | this.target.rawQuery = true;
16 | }
17 |
18 | getOptions(query) {
19 | // Options have to be transformed by uiSegmentSrv to be usable by metric-segment-model directive
20 | return this.datasource.metricFindQuery(query || '')
21 | .then(this.uiSegmentSrv.transformToSegments(false));
22 | }
23 |
24 | toggleEditorMode() {
25 | this.target.rawQuery = !this.target.rawQuery;
26 | }
27 |
28 | onChangeInternal() {
29 | this.panelCtrl.refresh(); // Asks the panel to refresh data.
30 | }
31 | }
32 |
33 | TimelionDatasourceQueryCtrl.templateUrl = 'partials/query.editor.html';
34 |
35 |
--------------------------------------------------------------------------------
/dist/partials/annotations.editor.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/partials/annotations.editor.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "grafana-timelion",
3 | "private": true,
4 | "version": "1.1.0",
5 | "description": "",
6 | "main": "index.js",
7 | "scripts": {
8 | "build": "./node_modules/grunt-cli/bin/grunt",
9 | "test": "./node_modules/grunt-cli/bin/grunt mochaTest"
10 | },
11 | "repository": {
12 | "type": "git",
13 | "url": "git+https://github.com/gbrian/grafana-timelion-datasource.git"
14 | },
15 | "author": "",
16 | "license": "ISC",
17 | "bugs": {
18 | "url": "https://github.com/gbrian/grafana-timelion-datasource/issues"
19 | },
20 | "engines": {
21 | "node": "6.10.0"
22 | },
23 | "engineStrict": true,
24 | "devDependencies": {
25 | "babel": "^6.23.0",
26 | "chai": "~3.5.0",
27 | "grunt": "^1.0.4",
28 | "grunt-babel": "~6.0.0",
29 | "grunt-cli": "^1.2.0",
30 | "grunt-contrib-clean": "^1.1.0",
31 | "grunt-contrib-copy": "^1.0.0",
32 | "grunt-contrib-uglify": "^2.3.0",
33 | "grunt-contrib-watch": "^1.0.0",
34 | "grunt-execute": "~0.2.2",
35 | "grunt-mocha-test": "^0.13.2",
36 | "grunt-systemjs-builder": "^1.0.0",
37 | "jsdom": "~9.12.0",
38 | "load-grunt-tasks": "^3.5.2",
39 | "prunk": "^1.3.0",
40 | "q": "^1.5.0"
41 | },
42 | "dependencies": {
43 | "babel-plugin-transform-es2015-for-of": "^6.6.0",
44 | "babel-plugin-transform-es2015-modules-systemjs": "^6.24.1",
45 | "babel-preset-es2015": "^6.24.1",
46 | "lodash": "^4.17.13",
47 | "mocha": "^5.2.0"
48 | },
49 | "homepage": "https://github.com/gbrian/grafana-timelion-datasource#readme"
50 | }
51 |
--------------------------------------------------------------------------------
/dist/module.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"sources":["../src/module.js"],"names":["TimelionDatasource","TimelionDatasourceQueryCtrl","TimelionConfigCtrl","$scope","datasourceSrv","current","jsonData","esVersion","templateUrl","GenericQueryOptionsCtrl","GenericAnnotationsQueryCtrl"],"mappings":";;;;;;;;;;;;;;;AAAQA,wB,eAAAA,kB;;AACAC,iC,eAAAA,2B;;;4BAEFC,kB,GACJ,4BAAYC,MAAZ,EAAoBC,aAApB,EAAmC;AAAA;;AACjC,aAAKA,aAAL,GAAqBA,aAArB;AACA,aAAKC,OAAL,CAAaC,QAAb,GAAwB,KAAKD,OAAL,CAAaC,QAAb,IAAyB,EAAjD;AACA,aAAKD,OAAL,CAAaC,QAAb,CAAsBC,SAAtB,GAAkC,KAAKF,OAAL,CAAaC,QAAb,CAAsBC,SAAtB,IAAmC,OAArE;AACD,O;;AAEHL,yBAAmBM,WAAnB,GAAiC,sBAAjC;;kCAEMC,uB;;;;AACNA,8BAAwBD,WAAxB,GAAsC,6BAAtC;;sCAEME,2B;;;;AACNA,kCAA4BF,WAA5B,GAA0C,kCAA1C;;4BAGER,kB;;2BACAC,2B;;4BACAC,kB;;kCACAO,uB;;sCACAC,2B","file":"module.js","sourcesContent":["import {TimelionDatasource} from './datasource';\nimport {TimelionDatasourceQueryCtrl} from './query_ctrl';\n\nclass TimelionConfigCtrl {\n constructor($scope, datasourceSrv) {\n this.datasourceSrv = datasourceSrv;\n this.current.jsonData = this.current.jsonData || {};\n this.current.jsonData.esVersion = this.current.jsonData.esVersion || '5.3.0';\n }\n}\nTimelionConfigCtrl.templateUrl = 'partials/config.html';\n\nclass GenericQueryOptionsCtrl {}\nGenericQueryOptionsCtrl.templateUrl = 'partials/query.options.html';\n\nclass GenericAnnotationsQueryCtrl {}\nGenericAnnotationsQueryCtrl.templateUrl = 'partials/annotations.editor.html'\n\nexport {\n TimelionDatasource as Datasource,\n TimelionDatasourceQueryCtrl as QueryCtrl,\n TimelionConfigCtrl as ConfigCtrl,\n GenericQueryOptionsCtrl as QueryOptionsCtrl,\n GenericAnnotationsQueryCtrl as AnnotationsQueryCtrl\n};\n"]}
--------------------------------------------------------------------------------
/Gruntfile.js:
--------------------------------------------------------------------------------
1 | module.exports = function(grunt) {
2 |
3 | require('load-grunt-tasks')(grunt);
4 |
5 | grunt.loadNpmTasks('grunt-execute');
6 | grunt.loadNpmTasks('grunt-contrib-clean');
7 |
8 | grunt.initConfig({
9 |
10 | clean: ["dist"],
11 |
12 | copy: {
13 | src_to_dist: {
14 | cwd: 'src',
15 | expand: true,
16 | src: ['**/*', '!**/*.js', '!**/*.scss'],
17 | dest: 'dist'
18 | },
19 | pluginDef: {
20 | expand: true,
21 | src: ['README.md'],
22 | dest: 'dist'
23 | }
24 | },
25 |
26 | watch: {
27 | rebuild_all: {
28 | files: ['src/**/*'],
29 | tasks: ['default'],
30 | options: {spawn: false}
31 | }
32 | },
33 |
34 | babel: {
35 | options: {
36 | sourceMap: true,
37 | presets: ['es2015']
38 | },
39 | dist: {
40 | options: {
41 | plugins: ['transform-es2015-modules-systemjs', 'transform-es2015-for-of']
42 | },
43 | files: [{
44 | cwd: 'src',
45 | expand: true,
46 | src: ['**/*.js'],
47 | dest: 'dist',
48 | ext:'.js'
49 | }]
50 | },
51 | distTestNoSystemJs: {
52 | files: [{
53 | cwd: 'src',
54 | expand: true,
55 | src: ['**/*.js'],
56 | dest: 'dist/test',
57 | ext:'.js'
58 | }]
59 | },
60 | distTestsSpecsNoSystemJs: {
61 | files: [{
62 | expand: true,
63 | cwd: 'spec',
64 | src: ['**/*.js'],
65 | dest: 'dist/test/spec',
66 | ext:'.js'
67 | }]
68 | }
69 | },
70 |
71 | mochaTest: {
72 | test: {
73 | options: {
74 | reporter: 'spec'
75 | },
76 | src: ['dist/test/spec/test-main.js', 'dist/test/spec/*_spec.js']
77 | }
78 | }
79 | });
80 |
81 | grunt.registerTask('default', ['clean', 'copy:src_to_dist', 'copy:pluginDef', 'babel'/*, 'mochaTest'*/]);
82 | };
83 |
--------------------------------------------------------------------------------
/dist/module.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | System.register(['./datasource', './query_ctrl'], function (_export, _context) {
4 | "use strict";
5 |
6 | var TimelionDatasource, TimelionDatasourceQueryCtrl, TimelionConfigCtrl, GenericQueryOptionsCtrl, GenericAnnotationsQueryCtrl;
7 |
8 | function _classCallCheck(instance, Constructor) {
9 | if (!(instance instanceof Constructor)) {
10 | throw new TypeError("Cannot call a class as a function");
11 | }
12 | }
13 |
14 | return {
15 | setters: [function (_datasource) {
16 | TimelionDatasource = _datasource.TimelionDatasource;
17 | }, function (_query_ctrl) {
18 | TimelionDatasourceQueryCtrl = _query_ctrl.TimelionDatasourceQueryCtrl;
19 | }],
20 | execute: function () {
21 | _export('ConfigCtrl', TimelionConfigCtrl = function TimelionConfigCtrl($scope, datasourceSrv) {
22 | _classCallCheck(this, TimelionConfigCtrl);
23 |
24 | this.datasourceSrv = datasourceSrv;
25 | this.current.jsonData = this.current.jsonData || {};
26 | this.current.jsonData.esVersion = this.current.jsonData.esVersion || '5.3.0';
27 | });
28 |
29 | TimelionConfigCtrl.templateUrl = 'partials/config.html';
30 |
31 | _export('QueryOptionsCtrl', GenericQueryOptionsCtrl = function GenericQueryOptionsCtrl() {
32 | _classCallCheck(this, GenericQueryOptionsCtrl);
33 | });
34 |
35 | GenericQueryOptionsCtrl.templateUrl = 'partials/query.options.html';
36 |
37 | _export('AnnotationsQueryCtrl', GenericAnnotationsQueryCtrl = function GenericAnnotationsQueryCtrl() {
38 | _classCallCheck(this, GenericAnnotationsQueryCtrl);
39 | });
40 |
41 | GenericAnnotationsQueryCtrl.templateUrl = 'partials/annotations.editor.html';
42 |
43 | _export('Datasource', TimelionDatasource);
44 |
45 | _export('QueryCtrl', TimelionDatasourceQueryCtrl);
46 |
47 | _export('ConfigCtrl', TimelionConfigCtrl);
48 |
49 | _export('QueryOptionsCtrl', GenericQueryOptionsCtrl);
50 |
51 | _export('AnnotationsQueryCtrl', GenericAnnotationsQueryCtrl);
52 | }
53 | };
54 | });
55 | //# sourceMappingURL=module.js.map
56 |
--------------------------------------------------------------------------------
/dist/query_ctrl.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"sources":["../src/query_ctrl.js"],"names":["QueryCtrl","TimelionDatasourceQueryCtrl","$scope","$injector","uiSegmentSrv","scope","target","type","interval","undefined","rawQuery","query","datasource","metricFindQuery","then","transformToSegments","panelCtrl","refresh","templateUrl"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAQA,e,kBAAAA,S;;;;;;;;;;;;;;;;;;;;;6CAGKC,2B;;;AAEX,6CAAYC,MAAZ,EAAoBC,SAApB,EAA+BC,YAA/B,EAA8C;AAAA;;AAAA,gKACtCF,MADsC,EAC9BC,SAD8B;;AAG5C,gBAAKE,KAAL,GAAaH,MAAb;AACA,gBAAKE,YAAL,GAAoBA,YAApB;AACA,gBAAKE,MAAL,CAAYA,MAAZ,GAAqB,MAAKA,MAAL,CAAYA,MAAZ,IAAsB,QAA3C;AACA,gBAAKA,MAAL,CAAYC,IAAZ,GAAmB,MAAKD,MAAL,CAAYC,IAAZ,IAAoB,WAAvC;AACA,gBAAKD,MAAL,CAAYE,QAAZ,GAAuB,MAAKF,MAAL,CAAYE,QAAZ,IAAwBC,SAA/C;AACA,cAAG,MAAKH,MAAL,CAAYI,QAAZ,KAAyBD,SAA5B,EACE,MAAKH,MAAL,CAAYI,QAAZ,GAAuB,IAAvB;AAT0C;AAU7C;;;;qCAEUC,K,EAAO;AAChB;AACA,mBAAO,KAAKC,UAAL,CAAgBC,eAAhB,CAAgCF,SAAS,EAAzC,EACJG,IADI,CACC,KAAKV,YAAL,CAAkBW,mBAAlB,CAAsC,KAAtC,CADD,CAAP;AAED;;;6CAEkB;AACjB,iBAAKT,MAAL,CAAYI,QAAZ,GAAuB,CAAC,KAAKJ,MAAL,CAAYI,QAApC;AACD;;;6CAEkB;AACjB,iBAAKM,SAAL,CAAeC,OAAf,GADiB,CACS;AAC3B;;;;QA1B8CjB,S;;;;AA6BjDC,kCAA4BiB,WAA5B,GAA0C,4BAA1C","file":"query_ctrl.js","sourcesContent":["import {QueryCtrl} from 'app/plugins/sdk';\nimport './css/query-editor.css!'\n\nexport class TimelionDatasourceQueryCtrl extends QueryCtrl {\n\n constructor($scope, $injector, uiSegmentSrv) {\n super($scope, $injector);\n\n this.scope = $scope;\n this.uiSegmentSrv = uiSegmentSrv;\n this.target.target = this.target.target || '.es(*)';\n this.target.type = this.target.type || 'timeserie';\n this.target.interval = this.target.interval || undefined;\n if(this.target.rawQuery === undefined)\n this.target.rawQuery = true;\n }\n\n getOptions(query) {\n // Options have to be transformed by uiSegmentSrv to be usable by metric-segment-model directive\n return this.datasource.metricFindQuery(query || '')\n .then(this.uiSegmentSrv.transformToSegments(false));\n }\n\n toggleEditorMode() {\n this.target.rawQuery = !this.target.rawQuery;\n }\n\n onChangeInternal() {\n this.panelCtrl.refresh(); // Asks the panel to refresh data.\n }\n}\n\nTimelionDatasourceQueryCtrl.templateUrl = 'partials/query.editor.html';\n\n"]}
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://github.com/gbrian/repofunding) [](https://www.paypal.me/repofunding/5)
2 |
3 | # grafana-timelion-datasource 
4 |
5 | ELK Timelion's data source for Grafana
6 |
7 | 
8 |
9 | ## Setup
10 |
11 | Set the url for your ES server like: http://server:port/api/timelion (Same server where your Kibana instance is running)
12 |
13 | ## Features
14 |
15 | ### Query
16 |
17 | Only query datasource feature is implemented.
18 | Multiple queries can be specified using same metric like: `.es(*).label(metric1),.es(q=*,offset=1d).label(metric2)`
19 | Or defining multiple metrics.
20 |
21 | Refer to Timelion's documentation for more details on writing queries: https://github.com/elastic/timelion/blob/master/FUNCTIONS.md
22 |
23 | ### Labeling
24 |
25 | Use the `label()` function to set the name of the metric
26 |
27 | ### Interval
28 |
29 | Use the `scale_interval()` function to specify metric interval. Grafana templating values are allowed
30 |
31 | ### Variables
32 |
33 | Starting with version 1.0.1 you can retrieve variables from Timelion labels.
34 |
35 | 
36 |
37 | ### Annotations
38 |
39 | You can query annotations using Timelion as follow:
40 |
41 | 
42 |
43 | Notes:
44 |
45 | - Data will be returned as `