From 0dc0e03c4c54663d1be58d40caeb68ebb6c3340d Mon Sep 17 00:00:00 2001 From: Ivan Babrou Date: Sun, 4 Oct 2015 12:54:43 +0100 Subject: [PATCH 01/22] Add suggest_tagk() and suggest_tagv() to OpenTSDB datasource (#2840) --- docs/sources/datasources/opentsdb.md | 6 ++++-- .../plugins/datasource/opentsdb/datasource.js | 20 +++++++++++++++---- public/test/specs/opentsdbDatasource-specs.js | 20 ++++++++++++++++++- 3 files changed, 39 insertions(+), 7 deletions(-) diff --git a/docs/sources/datasources/opentsdb.md b/docs/sources/datasources/opentsdb.md index 3368c39a0ae..bcaeed9056c 100644 --- a/docs/sources/datasources/opentsdb.md +++ b/docs/sources/datasources/opentsdb.md @@ -40,8 +40,10 @@ Grafana's OpenTSDB data source now supports template variable values queries. Th When using OpenTSDB with a template variable of `query` type you can use following syntax for lookup. - metrics() // returns metric names + metrics(prefix) // returns metric names with specific prefix (can be empty) tag_names(cpu) // return tag names (i.e. keys) for a specific cpu metric tag_values(cpu, hostname) // return tag values for metric cpu and tag key hostname + suggest_tagk(prefix) // return tag names (i.e. keys) for all metrics with specific prefix (can be empty) + suggest_tagv(prefix) // return tag values for all metrics with specific prefix (can be empty) -For details on opentsdb metric queries checkout the official [OpenTSDB documentation](http://opentsdb.net/docs/build/html/index.html) \ No newline at end of file +For details on opentsdb metric queries checkout the official [OpenTSDB documentation](http://opentsdb.net/docs/build/html/index.html) diff --git a/public/app/plugins/datasource/opentsdb/datasource.js b/public/app/plugins/datasource/opentsdb/datasource.js index 124c6597a00..c46b451a64c 100644 --- a/public/app/plugins/datasource/opentsdb/datasource.js +++ b/public/app/plugins/datasource/opentsdb/datasource.js @@ -80,8 +80,8 @@ function (angular, _, dateMath) { return backendSrv.datasourceRequest(options); }; - OpenTSDBDatasource.prototype._performSuggestQuery = function(query) { - return this._get('/api/suggest', {type: 'metrics', q: query, max: 1000}).then(function(result) { + OpenTSDBDatasource.prototype._performSuggestQuery = function(query, type) { + return this._get('/api/suggest', {type: type, q: query, max: 1000}).then(function(result) { return result.data; }); }; @@ -150,10 +150,12 @@ function (angular, _, dateMath) { var metrics_regex = /metrics\((.*)\)/; var tag_names_regex = /tag_names\((.*)\)/; var tag_values_regex = /tag_values\((.*),\s?(.*)\)/; + var tag_names_suggest_regex = /suggest_tagk\((.*)\)/; + var tag_values_suggest_regex = /suggest_tagv\((.*)\)/; var metrics_query = interpolated.match(metrics_regex); if (metrics_query) { - return this._performSuggestQuery(metrics_query[1]).then(responseTransform); + return this._performSuggestQuery(metrics_query[1], 'metrics').then(responseTransform); } var tag_names_query = interpolated.match(tag_names_regex); @@ -166,7 +168,17 @@ function (angular, _, dateMath) { return this._performMetricKeyValueLookup(tag_values_query[1], tag_values_query[2]).then(responseTransform); } - return $q.when([]); + var tag_names_suggest_query = interpolated.match(tag_names_suggest_regex); + if (tag_names_suggest_query) { + return this._performSuggestQuery(tag_names_suggest_query[1], 'tagk').then(responseTransform); + } + + var tag_values_suggest_query = interpolated.match(tag_values_suggest_regex); + if (tag_values_suggest_query) { + return this._performSuggestQuery(tag_values_suggest_query[1], 'tagv').then(responseTransform); + } + + return $q.when([{text: "wtf"}]); }; OpenTSDBDatasource.prototype.testDatasource = function() { diff --git a/public/test/specs/opentsdbDatasource-specs.js b/public/test/specs/opentsdbDatasource-specs.js index 57818fdc4fa..ecd2ca598e6 100644 --- a/public/test/specs/opentsdbDatasource-specs.js +++ b/public/test/specs/opentsdbDatasource-specs.js @@ -27,9 +27,11 @@ define([ }); it('metrics() should generate api suggest query', function() { - ctx.ds.metricFindQuery('metrics()').then(function(data) { results = data; }); + ctx.ds.metricFindQuery('metrics(pew)').then(function(data) { results = data; }); ctx.$rootScope.$apply(); expect(requestOptions.url).to.be('/api/suggest'); + expect(requestOptions.params.type).to.be('metrics'); + expect(requestOptions.params.q).to.be('pew'); }); it('tag_names(cpu) should generate looku query', function() { @@ -46,6 +48,22 @@ define([ expect(requestOptions.params.m).to.be('cpu{hostname=*}'); }); + it('suggest_tagk() should generate api suggest query', function() { + ctx.ds.metricFindQuery('suggest_tagk(foo)').then(function(data) { results = data; }); + ctx.$rootScope.$apply(); + expect(requestOptions.url).to.be('/api/suggest'); + expect(requestOptions.params.type).to.be('tagk'); + expect(requestOptions.params.q).to.be('foo'); + }); + + it('suggest_tagv() should generate api suggest query', function() { + ctx.ds.metricFindQuery('suggest_tagv(bar)').then(function(data) { results = data; }); + ctx.$rootScope.$apply(); + expect(requestOptions.url).to.be('/api/suggest'); + expect(requestOptions.params.type).to.be('tagv'); + expect(requestOptions.params.q).to.be('bar'); + }); + }); }); }); From 8a252774ce945589f362a55bd213fc3d3c6f22d1 Mon Sep 17 00:00:00 2001 From: Mitsuhiro Tanda Date: Thu, 29 Oct 2015 23:46:10 +0900 Subject: [PATCH 02/22] Update cloudwatch.md, add explanation about templating --- docs/sources/datasources/cloudwatch.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/sources/datasources/cloudwatch.md b/docs/sources/datasources/cloudwatch.md index c0ec51d6356..012da9d843a 100644 --- a/docs/sources/datasources/cloudwatch.md +++ b/docs/sources/datasources/cloudwatch.md @@ -54,6 +54,25 @@ Example content: You need to specify a namespace, metric, at least one stat, and at least one dimension. +## Templated queries +CloudWatch Datasource Plugin provides the following functions in `Variables values query` field in Templating Editor to query `region`, `namespaces`, `metric names` and `dimension keys/values` on the CloudWatch. + +Name | Description +------- | -------- +`regions()` | Returns a list of regions AWS provides their service. +`namespaces()` | Returns a list of namespaces CloudWatch support. +`metrics(namespace)` | Returns a list of metrics in the namespace. +`dimension_keys(namespace)` | Returns a list of dimension keys in the namespace. +`dimension_values(region, namespace, metric)` | Returns a list of dimension values matching the specified `region`, `namespace` and `metric`. + +For details about the metrics CloudWatch provides, please refer to the [CloudWatch documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/CW_Support_For_AWS.html). + +If you want to filter dimension values by other dimension key/value pair, you can specify optional parameter like this. +```sql +dimension_values(region, namespace, metric, dim_key1=dim_val1,dim_key2=dim_val2,...) +``` + +![](/img/v2/cloudwatch_templating.png) ## Cost From 2a8904f844f2b11972ab0976c8ebba49ec7aadf4 Mon Sep 17 00:00:00 2001 From: utkarshcmu Date: Thu, 29 Oct 2015 11:13:38 -0700 Subject: [PATCH 03/22] Fixed queryCtrl to use suggest API --- public/app/plugins/datasource/opentsdb/queryCtrl.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/app/plugins/datasource/opentsdb/queryCtrl.js b/public/app/plugins/datasource/opentsdb/queryCtrl.js index d5aa3db58ae..afbced89403 100644 --- a/public/app/plugins/datasource/opentsdb/queryCtrl.js +++ b/public/app/plugins/datasource/opentsdb/queryCtrl.js @@ -48,13 +48,13 @@ function (angular, _, kbn) { }; $scope.suggestTagKeys = function(query, callback) { - $scope.datasource.metricFindQuery('tag_names(' + $scope.target.metric + ')') + $scope.datasource.metricFindQuery('suggest_tagk(' + query + ')') .then($scope.getTextValues) .then(callback); }; $scope.suggestTagValues = function(query, callback) { - $scope.datasource.metricFindQuery('tag_values(' + $scope.target.metric + ',' + $scope.target.currentTagKey + ')') + $scope.datasource.metricFindQuery('suggest_tagv(' + query + ')') .then($scope.getTextValues) .then(callback); }; From a27186e34f1649c40dae796effd9854d7c8d052c Mon Sep 17 00:00:00 2001 From: utkarshcmu Date: Thu, 29 Oct 2015 11:28:38 -0700 Subject: [PATCH 04/22] Cleaned the codebase :D --- public/app/plugins/datasource/opentsdb/datasource.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/app/plugins/datasource/opentsdb/datasource.js b/public/app/plugins/datasource/opentsdb/datasource.js index c46b451a64c..b7d4bd2d37b 100644 --- a/public/app/plugins/datasource/opentsdb/datasource.js +++ b/public/app/plugins/datasource/opentsdb/datasource.js @@ -178,7 +178,7 @@ function (angular, _, dateMath) { return this._performSuggestQuery(tag_values_suggest_query[1], 'tagv').then(responseTransform); } - return $q.when([{text: "wtf"}]); + return $q.when([]); }; OpenTSDBDatasource.prototype.testDatasource = function() { From 8b9d13491f2e7efa88dd2f6fdbd6bfe7ee6926d4 Mon Sep 17 00:00:00 2001 From: utkarshcmu Date: Fri, 30 Oct 2015 02:07:08 -0700 Subject: [PATCH 05/22] Fixed some more typos in docs --- README.md | 2 +- docker/production/README.md | 4 ++-- docs/sources/tutorials/stack_guide_graphite.md | 10 +++++----- public/app/plugins/PLUGIN_CHANGES.md | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 8cf9992927b..8c48a4f7366 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ a standalone frontend only web application. Grafana 2.0 comes with a backend. - Click and drag to zoom - Multiple Y-axis, logarithmic scales - Bars, Lines, Points -- Smart Y-axis formating +- Smart Y-axis formatting - Series toggles & color selector - Legend values, and formatting options - Grid thresholds, axis labels diff --git a/docker/production/README.md b/docker/production/README.md index f6da10e62f6..9b0e23baf75 100644 --- a/docker/production/README.md +++ b/docker/production/README.md @@ -2,7 +2,7 @@ # Grafana docker image This container currently only contains the in development alpha of Grafana 2.0 (ie non production use). The -`#develop` tag is constantly updated as we make progress torwards a beta release. +`#develop` tag is constantly updated as we make progress towards a beta release. ## Running your Grafana image @@ -17,7 +17,7 @@ Try it out, default admin user is admin/admin. ## Configuring your Grafana container -All options defined in conf/grafana.ini can be overriden using environment variables, for example: +All options defined in conf/grafana.ini can be overridden using environment variables, for example: ``` diff --git a/docs/sources/tutorials/stack_guide_graphite.md b/docs/sources/tutorials/stack_guide_graphite.md index a9025cf9a71..1145cab2249 100644 --- a/docs/sources/tutorials/stack_guide_graphite.md +++ b/docs/sources/tutorials/stack_guide_graphite.md @@ -27,7 +27,7 @@ that is not really the case, or, at least, that it is a lot better than you expe To begin with we are going to install the 3 main components that define our metric stack. Later in the guide we will install StatsD, but that is optional. -- Carbon is the graphite ingestion deamon responsible for +- Carbon is the graphite ingestion daemon responsible for receiving metrics and storing them. - Graphite-api is light weight version of graphite-web with only the HTTP api and is responsible for executing metric queries. @@ -90,7 +90,7 @@ pattern = .* retentions = 10s:1d,1m:7d,10m:1y ``` -This config specifies the resolution of metrics and the retention periods. For example for all metrics begining with the word `carbon` receive metrics every minute and store for 30 days, then +This config specifies the resolution of metrics and the retention periods. For example for all metrics beginning with the word `carbon` receive metrics every minute and store for 30 days, then roll them up into 10 minute buckets and store those for 1 year, then roll those up into 1 hour buckets and store those for 5 years. For all other metrics the default rule will be applied with other retention periods. @@ -206,7 +206,7 @@ Reload supervisor supervisorctl reload -A carbon-cache deamon and graphite-api should now be running. Type `supervisorctl status` to verify that they are running. You can +A carbon-cache daemon and graphite-api should now be running. Type `supervisorctl status` to verify that they are running. You can also open `http://your_server_ip:8888/metrics/find?query?*` in your browser. You should see a json snippet. @@ -243,12 +243,12 @@ Open http://your_server_ip:3000 in your browser and login with the default user - Select `Add Panel` > `Graph` from the row menu - An empty graph panel should appear with title `no title (click here)`. Click on this title and then `Edit` - This will open the graph in edit mode and take you to the metrics tab. -- There is one query already added (asigned letter A) but it is empty. +- There is one query already added (assigned letter A) but it is empty. - Click on `select metric` to pick the first graphite metric node. A new `select metric` link will appear until you reached a leaf node. - Try picking the metric paths for `carbon.agents..cpuUsage`, you should now see a line appear in the graph! ## Writing metrics to Graphite -Graphite has the simples metric write protocol imaginable. Something that has surely contributed to its wide adoption by metric +Graphite has the simplest metric write protocol imaginable. Something that has surely contributed to its wide adoption by metric frameworks and numerous integrations. prod.server1.requests.count 10 1398969187 diff --git a/public/app/plugins/PLUGIN_CHANGES.md b/public/app/plugins/PLUGIN_CHANGES.md index b79a0b65948..138dab09931 100644 --- a/public/app/plugins/PLUGIN_CHANGES.md +++ b/public/app/plugins/PLUGIN_CHANGES.md @@ -10,6 +10,6 @@ datasource annotationQuery changed. now single options parameter with: 2.5 changed the `range` parameter in the `datasource.query` function's options parameter. This parameter now holds a parsed range with `moment` dates `form` and `to`. To get -millisecond epoc from a `moment` you the function `valueOf`. The raw date range as represented +millisecond epoch from a `moment` you the function `valueOf`. The raw date range as represented internally in grafana (which may be relative expressions like `now-5h`) is included in the new property `rangeRaw` (on the options object). From 2ca6acc1e975ca82b93071f550062d682d8ec2b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Bu=CC=88nemann?= Date: Sat, 31 Oct 2015 05:36:35 +0100 Subject: [PATCH 06/22] Fix npm 3 build failure in phantomjs task npm v3.0+ by default dedupes node modules and stores them in a flat tree, which means the hardcoded path to the location.js will no longer be nested under the karma-phantomjs-launcher module. This fixes issue #2999. --- tasks/options/phantomjs.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tasks/options/phantomjs.js b/tasks/options/phantomjs.js index 7eac7cb36ac..300688f5ba2 100644 --- a/tasks/options/phantomjs.js +++ b/tasks/options/phantomjs.js @@ -6,6 +6,11 @@ module.exports = function(config,grunt) { var dest = './vendor/phantomjs/phantomjs'; var confDir = './node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/' + if (!grunt.file.exists(confDir)) { + // npm 3 or npm 2 with dedupe + confDir = './node_modules/phantomjs/lib/'; + } + if (!grunt.file.exists(dest)){ var m=grunt.file.read(confDir+"location.js") From 03130e1217f09ea9bbff9caac52ebe20d853f9a8 Mon Sep 17 00:00:00 2001 From: Utkarsh Bhatnagar Date: Fri, 30 Oct 2015 22:11:17 -0700 Subject: [PATCH 07/22] Update opentsdb.md As we merged, changes with auto suggestions in the master branch. Update docs respectively. --- docs/sources/datasources/opentsdb.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/sources/datasources/opentsdb.md b/docs/sources/datasources/opentsdb.md index bcaeed9056c..14aa67ef31c 100644 --- a/docs/sources/datasources/opentsdb.md +++ b/docs/sources/datasources/opentsdb.md @@ -30,10 +30,9 @@ Open a graph in edit mode by click the title. ![](/img/v2/opentsdb_query_editor.png) ### Auto complete suggestions -You should get auto complete suggestions for tags and tag values. If you do not you need to enable `tsd.core.meta.enable_realtime_ts` in -the OpenTSDB server settings. +As soon as you start typing metric names, tag names and tag values , you should see highlighted auto complete suggestions for them. - > Note: This is required for the OpenTSDB `lookup` api to work. + > Note: This is required for the OpenTSDB `suggest` api to work. ## Templating queries Grafana's OpenTSDB data source now supports template variable values queries. This means you can create template variables that fetch the values from OpenTSDB (for example metric names, tag names, or tag values). The query editor is also enhanced to limiting tags by metric. @@ -46,4 +45,8 @@ When using OpenTSDB with a template variable of `query` type you can use followi suggest_tagk(prefix) // return tag names (i.e. keys) for all metrics with specific prefix (can be empty) suggest_tagv(prefix) // return tag values for all metrics with specific prefix (can be empty) +If you do not see template variables being populated in `Preview of values` section, you need to enable `tsd.core.meta.enable_realtime_ts` in the OpenTSDB server settings. Also, to populate metadata of the existing time series data in OpenTSDB, you need to run `tsd uid metasync` on the OpenTSDB server. + +> Note: This is required for the OpenTSDB `lookup` api to work. + For details on opentsdb metric queries checkout the official [OpenTSDB documentation](http://opentsdb.net/docs/build/html/index.html) From acb5340ffb24f75f35365ca04a8a8f77877774a2 Mon Sep 17 00:00:00 2001 From: Vitaliy Fuks Date: Sat, 31 Oct 2015 18:07:24 -0400 Subject: [PATCH 08/22] Fixed typo in OpenTSDB's "metasync" documentation --- docs/sources/datasources/opentsdb.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sources/datasources/opentsdb.md b/docs/sources/datasources/opentsdb.md index 14aa67ef31c..43fcda643ee 100644 --- a/docs/sources/datasources/opentsdb.md +++ b/docs/sources/datasources/opentsdb.md @@ -45,7 +45,7 @@ When using OpenTSDB with a template variable of `query` type you can use followi suggest_tagk(prefix) // return tag names (i.e. keys) for all metrics with specific prefix (can be empty) suggest_tagv(prefix) // return tag values for all metrics with specific prefix (can be empty) -If you do not see template variables being populated in `Preview of values` section, you need to enable `tsd.core.meta.enable_realtime_ts` in the OpenTSDB server settings. Also, to populate metadata of the existing time series data in OpenTSDB, you need to run `tsd uid metasync` on the OpenTSDB server. +If you do not see template variables being populated in `Preview of values` section, you need to enable `tsd.core.meta.enable_realtime_ts` in the OpenTSDB server settings. Also, to populate metadata of the existing time series data in OpenTSDB, you need to run `tsdb uid metasync` on the OpenTSDB server. > Note: This is required for the OpenTSDB `lookup` api to work. From 8448e3970b80a8dc03c3587c6b7f64a50f418c35 Mon Sep 17 00:00:00 2001 From: utkarshcmu Date: Sun, 1 Nov 2015 09:48:27 -0800 Subject: [PATCH 09/22] Removed unnecessary components. --- .../angular-native-dragdrop/.bower.json | 36 -- .../angular-native-dragdrop/Gulpfile.js | 15 - public/vendor/angular-native-dragdrop/LICENSE | 10 - .../vendor/angular-native-dragdrop/bower.json | 27 -- .../demo/css/styles.css | 29 -- .../angular-native-dragdrop/demo/index.html | 129 ------- .../angular-native-dragdrop/demo/js/app.js | 46 --- .../docs/css/styles.css | 32 -- .../angular-native-dragdrop/docs/index.html | 323 ------------------ .../angular-native-dragdrop/package.json | 24 -- 10 files changed, 671 deletions(-) delete mode 100644 public/vendor/angular-native-dragdrop/.bower.json delete mode 100644 public/vendor/angular-native-dragdrop/Gulpfile.js delete mode 100644 public/vendor/angular-native-dragdrop/LICENSE delete mode 100644 public/vendor/angular-native-dragdrop/bower.json delete mode 100644 public/vendor/angular-native-dragdrop/demo/css/styles.css delete mode 100644 public/vendor/angular-native-dragdrop/demo/index.html delete mode 100644 public/vendor/angular-native-dragdrop/demo/js/app.js delete mode 100644 public/vendor/angular-native-dragdrop/docs/css/styles.css delete mode 100644 public/vendor/angular-native-dragdrop/docs/index.html delete mode 100644 public/vendor/angular-native-dragdrop/package.json diff --git a/public/vendor/angular-native-dragdrop/.bower.json b/public/vendor/angular-native-dragdrop/.bower.json deleted file mode 100644 index 6cef5b66f76..00000000000 --- a/public/vendor/angular-native-dragdrop/.bower.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "angular-native-dragdrop", - "version": "1.1.1", - "homepage": "http://angular-dragdrop.github.io/angular-dragdrop", - "authors": [ - "ganarajpr" - ], - "description": "Angular HTML5 Drag and Drop directive written in pure with no dependency on JQuery.", - "main": "draganddrop.js", - "keywords": [ - "angular", - "drag", - "drop", - "html5" - ], - "dependencies": { - "angular": "^1.3" - }, - "license": "MIT", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ], - "_release": "1.1.1", - "_resolution": { - "type": "version", - "tag": "v1.1.1", - "commit": "4ff89cb0aa61070508e935729fb816fd46a58f60" - }, - "_source": "git://github.com/angular-dragdrop/angular-dragdrop.git", - "_target": "~1.1.1", - "_originalSource": "angular-native-dragdrop" -} \ No newline at end of file diff --git a/public/vendor/angular-native-dragdrop/Gulpfile.js b/public/vendor/angular-native-dragdrop/Gulpfile.js deleted file mode 100644 index 0aa3bdfff72..00000000000 --- a/public/vendor/angular-native-dragdrop/Gulpfile.js +++ /dev/null @@ -1,15 +0,0 @@ -/* jshint -W097 */ -'use strict'; - -/* global require */ -var jshint = require('gulp-jshint'); -var stylish = require('jshint-stylish'); -var gulp = require('gulp'); - -gulp.task('lint', function() { - return gulp.src('./draganddrop.js') - .pipe(jshint()) - .pipe(jshint.reporter(stylish)); -}); - -gulp.task('default', ['lint']); diff --git a/public/vendor/angular-native-dragdrop/LICENSE b/public/vendor/angular-native-dragdrop/LICENSE deleted file mode 100644 index d239cb9e0d3..00000000000 --- a/public/vendor/angular-native-dragdrop/LICENSE +++ /dev/null @@ -1,10 +0,0 @@ - -The MIT License - -Copyright (c) 2015 Ganaraj P R, [Nebithi](http://www.nebithi.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/public/vendor/angular-native-dragdrop/bower.json b/public/vendor/angular-native-dragdrop/bower.json deleted file mode 100644 index 8ffcb8869a7..00000000000 --- a/public/vendor/angular-native-dragdrop/bower.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "angular-native-dragdrop", - "version": "1.1.1", - "homepage": "http://angular-dragdrop.github.io/angular-dragdrop", - "authors": [ - "ganarajpr" - ], - "description": "Angular HTML5 Drag and Drop directive written in pure with no dependency on JQuery.", - "main": "draganddrop.js", - "keywords": [ - "angular", - "drag", - "drop", - "html5" - ], - "dependencies": { - "angular": "^1.3" - }, - "license": "MIT", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ] -} diff --git a/public/vendor/angular-native-dragdrop/demo/css/styles.css b/public/vendor/angular-native-dragdrop/demo/css/styles.css deleted file mode 100644 index 4dd18383697..00000000000 --- a/public/vendor/angular-native-dragdrop/demo/css/styles.css +++ /dev/null @@ -1,29 +0,0 @@ -body { - background-color: #f8f7f8; -} - -.heading { - border-bottom: 1px solid #b7b7b7; - padding-bottom: 10px; - margin-bottom: 10px; -} - -.topRow { - margin-bottom: 30px; -} - -.on-drag-enter { - background-color : #677ba6; -} - -.on-drag-enter-custom { - background-color : #d78cc7; -} - -.on-drag-hover { - background-color : #3eb352; -} - -.on-drag-hover-custom { - background-color : #d7a931; -} \ No newline at end of file diff --git a/public/vendor/angular-native-dragdrop/demo/index.html b/public/vendor/angular-native-dragdrop/demo/index.html deleted file mode 100644 index 9693e8f8c95..00000000000 --- a/public/vendor/angular-native-dragdrop/demo/index.html +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - Angular DragDrop (Demo) - - - - - - - - - - -
-
-

- Drag and drop between the two lists. -

-
- -

Beasts

- -

Left column of beasts is not draggable and accepts both beasts and priests

- -
- -
-
-
    -
  • - {{man}} -
  • -
-
-
-
    -
  • - {{woman}} -
  • -
-
-
- -
- -

Priests

- -
- -
-
-
    -
  • - {{man}} -
  • -
-
-
-
    -
  • - {{woman}} -
  • -
-
-
- -
- -

Terrorists

- -

Each terrorist list item accepts a new terrorist. Shows inserting into a particular - position in an array.

- -
- - -
-
-
    -
  • - {{man}} -
  • -
-
-
-
    -
  • - {{woman}} -
  • -
-
-
-
- - - diff --git a/public/vendor/angular-native-dragdrop/demo/js/app.js b/public/vendor/angular-native-dragdrop/demo/js/app.js deleted file mode 100644 index 7fca20ac0ce..00000000000 --- a/public/vendor/angular-native-dragdrop/demo/js/app.js +++ /dev/null @@ -1,46 +0,0 @@ -angular.module('app', [ - 'hljs', - 'ang-drag-drop' -]).controller('MainCtrl', function($scope) { - $scope.men = [ - 'John', - 'Jack', - 'Mark', - 'Ernie', - 'Mike (Locked)' - ]; - - - $scope.women = [ - 'Jane', - 'Jill', - 'Betty', - 'Mary' - ]; - - $scope.addText = ''; - - $scope.dropValidateHandler = function($drop, $event, $data) { - if ($data === 'Mike (Locked)') { - return false; - } - if ($drop.element[0] === $event.srcElement.parentNode) { - // Don't allow moving to same container - return false; - } - return true; - }; - - $scope.dropSuccessHandler = function($event, index, array) { - array.splice(index, 1); - }; - - $scope.onDrop = function($event, $data, array, index) { - if (index !== undefined) { - array.splice(index, 0, $data); - } else { - array.push($data); - } - }; - -}); diff --git a/public/vendor/angular-native-dragdrop/docs/css/styles.css b/public/vendor/angular-native-dragdrop/docs/css/styles.css deleted file mode 100644 index d4480e8b536..00000000000 --- a/public/vendor/angular-native-dragdrop/docs/css/styles.css +++ /dev/null @@ -1,32 +0,0 @@ -.content { - margin : 50px auto; - font-size: 1.0em; - line-height: 1.5em; -} - -.content a{ - color: #677BA6; - cursor: pointer; -} - -body { - background-color: #f8f7f8; -} - -.jumbotron h1, -.jumbotron p{ - font-family: 'Open Sans'; -} - -.heading{ - border-bottom: 1px solid #b7b7b7; - padding-bottom: 10px; - margin-bottom: 10px; -} - -.ribbon{ - position: fixed; - top : 0; - right : 0; - z-index: 2000; -} \ No newline at end of file diff --git a/public/vendor/angular-native-dragdrop/docs/index.html b/public/vendor/angular-native-dragdrop/docs/index.html deleted file mode 100644 index 25603db4e34..00000000000 --- a/public/vendor/angular-native-dragdrop/docs/index.html +++ /dev/null @@ -1,323 +0,0 @@ - - - - Angular DragDrop - - - - - - - - - - -Fork me on GitHub -
-
-

Angular Drag and Drop

- -

Angular-DragDrop is a AngularJS HTML5 Drag and Drop directive written in pure with no dependency on JQuery.

- - -
- - -
-
-

Directives

-
- -

ui-draggable

- -

- directive in module ngDragDrop -

- -

The ui-draggable attribute tells Angular that the element is draggable. ui-draggable - takes an expression as the attribute value. The expression should evaluate to either true or false. - You can toggle the draggability of an element using this expression. -

- - -

Additional Attributes

- -

drag

- -

The drag property is used to assign the data that needs to be passed along with the dragging - element.

-
-

drag-handle-class

- -

The class used to mark child elements of draggable object to be used as drag handle. Default class name is - drag-handle.

-
- NOTE: If attribute is not present drag handle feature is not active. -
-
-

on-drop-success

- -

The on-drop-success attribute takes a function. We can consider this to be an on-drop-success - handler function. - This can be useful if you need to do some post processing after the dragged element is dropped successfully on - the drop site. - -

- NOTE: This callback function is only called when the drop succeeds. -
- You can request the drag-end event ( very similiar to requesting the click event in - ng-click ) - by passing $event in the event handler. -

- -
-

on-drop-failure

- -

The on-drop-failure attribute takes a function. We can consider this to be an on-drop-failure - handler function. - This can be useful if you need to do some post processing after the dragged element is dropped unsuccessfully on - any drop site. - -

- NOTE: This callback function is only called when the drop fails. -
- You can request the drag-end event ( very similiar to requesting the click event in - ng-click ) - by passing $event in the event handler. -

- - -
-

Usage

- -

- -

- ... - -
-

- -

Details

- -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParamTypeDetails
ui-draggableExpression that should be - evaluated. The given expression should resolve to true or false. -
dragTakes any JSON convertable $scope variable.
drag-handle-classClass name used to mark child elements of draggable object to be used as drag handle.
If attribute - is not present drag handle feature is not used.
If attribute is present but have no value - drag-handle used as default.
on-drop-successTakes any $scope function. Can also pass $event.
on-drop-failureTakes any $scope function. Can also pass $event.
drag-channelTakes a string that can be used as the channel name for the dragging operation. - Default channel is "defaultchannel" -
-

-
- -

Events

- -

On start of dragging an Angular Event ANGULAR_DRAG_START is dispatched from the - $rootScope. The event also carries - carries the information about the channel in which the dragging has started. -

- -

On end of dragging an Angular Event ANGULAR_DRAG_END is dispatched from the $rootScope. - The event also carries - carries the information about the channel in which the dragging has started. -

- -

When hovering a draggable element on top of a drop area an Angular Event ANGULAR_HOVER - is dispatched from the $rootScope. - The event also carries the information about the channel in which the dragging has started. -

- -
- -

ui-on-drop

- -

- directive in module ngDragDrop -

- -

The ui-on-drop attribute tells Angular that the element is a drop site. ui-on-drop - takes a function as the attribute value. The function will be called when a valid dragged element is dropped in - that location. - A valid dragged element is one which has the same channel as the drop location. - -

- NOTE : This callback function is only called when the drop succeeds. -
- The ui-on-drop callback can request additional parameters. The data that is dragged is available to the - callback as $data and its channel as $channel. Apart from this the drop event is exposed as $event. -

-

Additional Attributes

- -

drop-channel

- -

The channel that the drop site accepts. The dragged element should have the same channel as this drop site for it - to be droppable at this location. It is possible to provide comma separated list of channels. - -

- NOTE: Also special value of drag-channel attribute is available to accept - dragged element with any channel value — * -
-

- -
- -

drop-validate

- -

Extra validation that makes sure that the drop site accepts the dragged element beyond having the same channel. If - not defined, no extra validation is made. - -

- NOTE: This callback function is called only if the channel condition is met, when the element - starts being dragged -
-

- -
- -

drag-enter-class

- -

The class that will be added to the the droppable element when a dragged element ( which is droppable ) - enters the drop location. The default value for this is on-drag-enter

- -

drag-hover-class

- -

The class that will be added to the drop area element when hovering with an element. - The default value for this is on-drag-hover

- -
-

Usage

- -

- -

- ... -
-

- -

Details

- -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParamTypeDetails
ui-on-dropTakes any $scope function. Can also pass $event, $data and $channel. -
drop-channelThe channel on which the drop has to listen for drag events.
- Single value, comma separated list or special value * are possible
drop-validateTakes any $scope function. Can also pass $data and $channel -
drag-enter-classA class name that will be put on the droppable element when the dragged objects enters its boundaries. -
Default class name is on-drag-enter.
drag-hover-classA class name that will be put on the drop area when an element is dragged onto it.
Default class - name is on-drag-hover.
-

-
-

Demo

- - - -
-
- - - - - diff --git a/public/vendor/angular-native-dragdrop/package.json b/public/vendor/angular-native-dragdrop/package.json deleted file mode 100644 index 30aa4f51205..00000000000 --- a/public/vendor/angular-native-dragdrop/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "angular-native-dragdrop", - "version": "1.1.1", - "description": "Angular HTML5 Drag and Drop directive written in pure with no dependency on JQuery.", - "main": "draganddrop.js", - "scripts": { - "test": "gulp" - }, - "repository": { - "type": "git", - "url": "https://github.com/angular-dragdrop/angular-dragdrop.git" - }, - "author": "ganarajpr", - "license": "MIT", - "bugs": { - "url": "https://github.com/angular-dragdrop/angular-dragdrop/issues" - }, - "homepage": "http://angular-dragdrop.github.io/angular-dragdrop", - "devDependencies": { - "gulp": "^3.8.11", - "gulp-jshint": "^1.9.2", - "jshint-stylish": "^1.0.1" - } -} From 51003396040f994d0a0f3375ef0079ac630d154b Mon Sep 17 00:00:00 2001 From: utkarshcmu Date: Sun, 1 Nov 2015 22:58:14 -0800 Subject: [PATCH 10/22] Initialized dashboard JSON doc. --- docs/sources/reference/dashboard.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 docs/sources/reference/dashboard.md diff --git a/docs/sources/reference/dashboard.md b/docs/sources/reference/dashboard.md new file mode 100644 index 00000000000..e69de29bb2d From 3a021a87a1df417b1e1478f39e4d209e1b22ae87 Mon Sep 17 00:00:00 2001 From: utkarshcmu Date: Sun, 1 Nov 2015 23:17:23 -0800 Subject: [PATCH 11/22] Added JSON of new dashboard --- docs/sources/reference/dashboard.md | 80 +++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/docs/sources/reference/dashboard.md b/docs/sources/reference/dashboard.md index e69de29bb2d..1a05ff596c8 100644 --- a/docs/sources/reference/dashboard.md +++ b/docs/sources/reference/dashboard.md @@ -0,0 +1,80 @@ +---- +page_title: Dashboard JSON +page_description: Dashboard JSON Reference +page_keywords: grafana, dashboard, json, documentation +--- + +# Dashboard JSON + +## Overview + +A dashboard in Grafana is represented by a JSON object, which stores dashboard metadata, rows of panels, panel queries, etc. + + + +> To view the JSON of a dashboard, you can click on "Manage dashboard" cog menu and select "View JSON" from it. + +## Basic fields + +A dashboard JSON object is initialized with the following fields when it is created. + +``` +{ + "id": null, + "title": "New dashboard", + "originalTitle": "New dashboard", + "tags": [], + "style": "dark", + "timezone": "browser", + "editable": true, + "hideControls": false, + "sharedCrosshair": false, + "rows": [ + { + "height": "250px", + "panels": [], + "title": "Row", + "collapse": false, + "editable": true + } + ], + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": { + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ], + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ] + }, + "templating": { + "list": [] + }, + "annotations": { + "list": [] + }, + "schemaVersion": 7, + "version": 0, + "links": [] +} +``` From ada641090f04284dc9ff2f6b05c37ec9d5dddf02 Mon Sep 17 00:00:00 2001 From: Utkarsh Bhatnagar Date: Sun, 1 Nov 2015 23:53:24 -0800 Subject: [PATCH 12/22] Explained basic JSON fields --- docs/sources/reference/dashboard.md | 35 ++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/docs/sources/reference/dashboard.md b/docs/sources/reference/dashboard.md index 1a05ff596c8..c5bea813802 100644 --- a/docs/sources/reference/dashboard.md +++ b/docs/sources/reference/dashboard.md @@ -8,15 +8,19 @@ page_keywords: grafana, dashboard, json, documentation ## Overview -A dashboard in Grafana is represented by a JSON object, which stores dashboard metadata, rows of panels, panel queries, etc. +A dashboard in Grafana is represented by a JSON object, which stores metadata of its dashboard. Dashboard metadata includes dashboard properties, metadata from rows, panels, template variables, panel queries, etc. - +To view the JSON of a dashboard, follow the steps mentioned below: -> To view the JSON of a dashboard, you can click on "Manage dashboard" cog menu and select "View JSON" from it. + 1. Go to a dashboard + 2. Click on `Manage dashboard` menu on the top navigation bar + 3. Select `View JSON` from the dropdown menu ## Basic fields -A dashboard JSON object is initialized with the following fields when it is created. +When a user creates a new dashboard, a new dashboard JSON object is initialized with the following fields: + +> Note: In the following JSON, id is shown as null which is the default value assigned to it until the dashboard is not saved. Once saved, an integer value is assigned to the `id` field. ``` { @@ -26,7 +30,7 @@ A dashboard JSON object is initialized with the following fields when it is crea "tags": [], "style": "dark", "timezone": "browser", - "editable": true, + "editable": true, "hideControls": false, "sharedCrosshair": false, "rows": [ @@ -78,3 +82,24 @@ A dashboard JSON object is initialized with the following fields when it is crea "links": [] } ``` +Each field in the dashboard JSON is explained below with its usage: + +| Name | Usage | +| ---- | ----- | +| **id** | unique dashboard id, an integer | +| **title** | current title of dashboard | +| **originalTitle** | title of dashboard when saved for the first time | +| **tags** | an array of strings storing tags associated with dashboard | +| **style** | theme of dashboard, i.e. dark or light | +| **timezone** | timezone of dashboard, i.e. utc or browser | +| **editable** | whether a dashboard is editable or not | +| **hideControls** | whether row controls on the left in green are hidden or not | +| **sharedCrosshair** | TODO | +| **rows** | row metadata, see rows section for details | +| **time** | time range of dashboard, i.e. last 6 hours, last 7 days, etc | +| **timepicker** | timepicker metadata, see timepicker section for details | +| **templating** | timeplating metadata, see templating section for details | +| **annotations** | annotations metadata, see annotations section for details | +| **schemaVersion** | TODO | +| **version** | TODO | +| **links** | TODO | From 4c1b6f3059111e74464f7410a20fdc4acc3480ab Mon Sep 17 00:00:00 2001 From: utkarshcmu Date: Sun, 1 Nov 2015 23:55:03 -0800 Subject: [PATCH 13/22] Fixed a typo --- docs/sources/reference/dashboard.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sources/reference/dashboard.md b/docs/sources/reference/dashboard.md index c5bea813802..16481829f82 100644 --- a/docs/sources/reference/dashboard.md +++ b/docs/sources/reference/dashboard.md @@ -98,7 +98,7 @@ Each field in the dashboard JSON is explained below with its usage: | **rows** | row metadata, see rows section for details | | **time** | time range of dashboard, i.e. last 6 hours, last 7 days, etc | | **timepicker** | timepicker metadata, see timepicker section for details | -| **templating** | timeplating metadata, see templating section for details | +| **templating** | templating metadata, see templating section for details | | **annotations** | annotations metadata, see annotations section for details | | **schemaVersion** | TODO | | **version** | TODO | From f54615ed46a1741a5fd23928ff8874ce9f7819cd Mon Sep 17 00:00:00 2001 From: Utkarsh Bhatnagar Date: Mon, 2 Nov 2015 00:21:59 -0800 Subject: [PATCH 14/22] Included rows JSON and TODO headers --- docs/sources/reference/dashboard.md | 104 +++++++++++++++++----------- 1 file changed, 62 insertions(+), 42 deletions(-) diff --git a/docs/sources/reference/dashboard.md b/docs/sources/reference/dashboard.md index 16481829f82..cdef0c75119 100644 --- a/docs/sources/reference/dashboard.md +++ b/docs/sources/reference/dashboard.md @@ -16,11 +16,11 @@ To view the JSON of a dashboard, follow the steps mentioned below: 2. Click on `Manage dashboard` menu on the top navigation bar 3. Select `View JSON` from the dropdown menu -## Basic fields +## JSON fields When a user creates a new dashboard, a new dashboard JSON object is initialized with the following fields: -> Note: In the following JSON, id is shown as null which is the default value assigned to it until the dashboard is not saved. Once saved, an integer value is assigned to the `id` field. +> Note: In the following JSON, id is shown as null which is the default value assigned to it until a dashboard is saved. Once a dashboard is saved, an integer value is assigned to the `id` field. ``` { @@ -33,43 +33,14 @@ When a user creates a new dashboard, a new dashboard JSON object is initialized "editable": true, "hideControls": false, "sharedCrosshair": false, - "rows": [ - { - "height": "250px", - "panels": [], - "title": "Row", - "collapse": false, - "editable": true - } - ], + "rows": [], "time": { "from": "now-6h", "to": "now" }, "timepicker": { - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ], - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ] + "time_options": [], + "refresh_intervals": [] }, "templating": { "list": [] @@ -89,17 +60,66 @@ Each field in the dashboard JSON is explained below with its usage: | **id** | unique dashboard id, an integer | | **title** | current title of dashboard | | **originalTitle** | title of dashboard when saved for the first time | -| **tags** | an array of strings storing tags associated with dashboard | -| **style** | theme of dashboard, i.e. dark or light | -| **timezone** | timezone of dashboard, i.e. utc or browser | +| **tags** | tags associated with dashboard, an array of strings | +| **style** | theme of dashboard, i.e. `dark` or `light` | +| **timezone** | timezone of dashboard, i.e. `utc` or `browser` | | **editable** | whether a dashboard is editable or not | | **hideControls** | whether row controls on the left in green are hidden or not | | **sharedCrosshair** | TODO | -| **rows** | row metadata, see rows section for details | -| **time** | time range of dashboard, i.e. last 6 hours, last 7 days, etc | -| **timepicker** | timepicker metadata, see timepicker section for details | -| **templating** | templating metadata, see templating section for details | -| **annotations** | annotations metadata, see annotations section for details | +| **rows** | row metadata, see [rows section](/dashboard/#rows) for details | +| **time** | time range for dashboard, i.e. last 6 hours, last 7 days, etc | +| **timepicker** | timepicker metadata, see [timepicker section](/dashboard/#timepicker) for details | +| **templating** | templating metadata, see [templating section](/dashboard/#templating) for details | +| **annotations** | annotations metadata, see [annotations section](/dashboard/#annotations) for details | | **schemaVersion** | TODO | | **version** | TODO | | **links** | TODO | + +### rows + +`rows` field represents an array of JSON object representing each row in a dashboard, such as shown below: + +``` + "rows": [ + { + "collapse": false, + "editable": true, + "height": "200px", + "panels": [], + "title": "New row" + }, + { + "collapse": true, + "editable": true, + "height": "300px", + "panels": [], + "title": "New row" + } + ] +``` + +Usage of the fields is explained below: + +| Name | Usage | +| ---- | ----- | +| **collapse** | whether row is collapsed or not | +| **editable** | whether a row is editable or not | +| **height** | height of the row in pixels | +| **panels** | panels metadata, see [panels section](/dashboard/#panels) for details | +| **title** | title of row | + +#### panels + +TODO + +### timepicker + +TODO + +### templating + +TODO + +### annotations + +TODO From e8c9b0806abb0ea84e3223d6a87d53f1c9171352 Mon Sep 17 00:00:00 2001 From: Utkarsh Bhatnagar Date: Mon, 2 Nov 2015 10:15:40 -0800 Subject: [PATCH 15/22] Added templating, timepicker, panel docs --- docs/sources/reference/dashboard.md | 305 +++++++++++++++++++++++++++- 1 file changed, 301 insertions(+), 4 deletions(-) diff --git a/docs/sources/reference/dashboard.md b/docs/sources/reference/dashboard.md index cdef0c75119..1a289208e3a 100644 --- a/docs/sources/reference/dashboard.md +++ b/docs/sources/reference/dashboard.md @@ -77,7 +77,7 @@ Each field in the dashboard JSON is explained below with its usage: ### rows -`rows` field represents an array of JSON object representing each row in a dashboard, such as shown below: +`rows` field consists of an array of JSON object representing each row in a dashboard, such as shown below: ``` "rows": [ @@ -110,15 +110,312 @@ Usage of the fields is explained below: #### panels -TODO +Panels are the building blocks a dashboard. It consists of datasource queries, type of graphs, aliases, etc. Panel JSON consists of an array of JSON objects, each representing a different panel in a row. Most of the fields are common for all panels but some fields depends on the panel type. Following is an example of panel JSON representing a `graph` panel type: + +``` +"panels": [ + { + "aliasColors": {}, + "bars": false, + "datasource": null, + "editable": true, + "error": false, + "fill": 0, + "grid": { + "leftLogBase": 1, + "leftMax": null, + "leftMin": null, + "rightLogBase": 1, + "rightMax": null, + "rightMin": null, + "threshold1": null, + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2": null, + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, + "id": 1, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 4, + "stack": false, + "steppedLine": false, + "targets": [ + { + "aggregator": "max", + "alias": "$tag_instance_id", + "currentTagKey": "", + "currentTagValue": "", + "downsampleAggregator": "avg", + "downsampleInterval": "", + "errors": {}, + "metric": "memory.percent-used", + "refId": "A", + "shouldComputeRate": false, + "tags": { + "app": "$app", + "env": "stage", + "instance_id": "*" + } + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Memory Utilization", + "tooltip": { + "shared": true, + "value_type": "cumulative" + }, + "type": "graph", + "x-axis": true, + "y-axis": true, + "y_formats": [ + "percent", + "short" + ] + }, + { + "aliasColors": {}, + "bars": false, + "datasource": null, + "editable": true, + "error": false, + "fill": 0, + "grid": { + "leftLogBase": 1, + "leftMax": null, + "leftMin": null, + "rightLogBase": 1, + "rightMax": null, + "rightMin": null, + "threshold1": null, + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2": null, + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, + "id": 2, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 4, + "stack": false, + "steppedLine": false, + "targets": [ + { + "aggregator": "avg", + "alias": "$tag_instance_id", + "currentTagKey": "", + "currentTagValue": "", + "downsampleAggregator": "avg", + "downsampleInterval": "", + "errors": {}, + "metric": "memory.percent-cached", + "refId": "A", + "shouldComputeRate": false, + "tags": { + "app": "$app", + "env": "prod", + "instance_id": "*" + } + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Memory Cached", + "tooltip": { + "shared": true, + "value_type": "cumulative" + }, + "type": "graph", + "x-axis": true, + "y-axis": true, + "y_formats": [ + "short", + "short" + ] + }, +``` + +Usage of each field is explained below: + +| Name | Usage | +| ---- | ----- | +| TODO | TODO | ### timepicker -TODO +Description: TODO + +``` +"timepicker": { + "collapse": false, + "enable": true, + "notice": false, + "now": true, + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "status": "Stable", + "time_options": [ + "5m", + "15m", + "1h", + "3h", + "6h", + "12h", + "24h", + "2d", + "3d", + "4d", + "7d", + "30d" + ], + "type": "timepicker" + } +``` + +Usage of the fields is explained below: + +| Name | Usage | +| ---- | ----- | +| **collapse** | whether timepicker is collapsed or not | +| **enable** | whether timepicker is enabled or not | +| **notice** | TODO | +| **now** | TODO | +| **refresh_intervals** | TODO | +| **status** | TODO | +| **time_options** | TODO | +| **type** | TODO | ### templating -TODO +`templating` fields contains array of template variables with their saved values along with some other metadata, for example: + +``` + "templating": { + "enable": true, + "list": [ + { + "allFormat": "wildcard", + "current": { + "tags": [], + "text": "prod", + "value": "prod" + }, + "datasource": null, + "includeAll": true, + "name": "env", + "options": [ + { + "selected": false, + "text": "All", + "value": "*" + }, + { + "selected": false, + "text": "stage", + "value": "stage" + }, + { + "selected": false, + "text": "test", + "value": "test" + } + ], + "query": "tag_values(cpu.utilization.average,env)", + "refresh": false, + "refresh_on_load": false, + "type": "query" + }, + { + "allFormat": "wildcard", + "current": { + "text": "apache", + "value": "apache" + }, + "datasource": null, + "includeAll": false, + "multi": false, + "multiFormat": "glob", + "name": "app", + "options": [ + { + "selected": true, + "text": "tomcat", + "value": "tomcat" + }, + { + "selected": false, + "text": "cassandra", + "value": "cassandra" + } + ], + "query": "tag_values(cpu.utilization.average,app)", + "refresh_on_load": false, + "regex": "", + "type": "query" + } + ] + } +``` + +Usage of the above mentioned fields in the templating section is explained below: + +| Name | Usage | +| ---- | ----- | +| **enable** | whether templating is enabled or not | +| **list** | an array of objects representing, each representing one template variable | +| **allFormat** | format to use while fetching all values from datasource, eg: `wildcard`, `glob`, `regex`, `pipe`, etc. | +| **current** | shows current selected variable text/value on the dashboard | +| **datasource** | shows datasource for the variables | +| **includeAll** | whether all value option is available or not | +| **multi** | whether multiple values can be selected or not from variable value list | +| **multiFormat** | format to use while fetching timeseries from datasource | +| **name** | name of variable | +| **options** | array of variable text/value pairs available for selection on dashboard | +| **query** | datasource query used to fetch values for a variable | +| **refresh_on_load** | TODO | +| **regex** | TODO | +| **type** | type of variable, i.e. `custom`, `query` or `interval` | ### annotations From f14ef22bb6be96ed2cb1ccc0ec52a903c1e44a82 Mon Sep 17 00:00:00 2001 From: Utkarsh Bhatnagar Date: Mon, 2 Nov 2015 10:25:33 -0800 Subject: [PATCH 16/22] Fixed doc links --- docs/sources/reference/dashboard.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/sources/reference/dashboard.md b/docs/sources/reference/dashboard.md index 1a289208e3a..60064690fb2 100644 --- a/docs/sources/reference/dashboard.md +++ b/docs/sources/reference/dashboard.md @@ -66,11 +66,11 @@ Each field in the dashboard JSON is explained below with its usage: | **editable** | whether a dashboard is editable or not | | **hideControls** | whether row controls on the left in green are hidden or not | | **sharedCrosshair** | TODO | -| **rows** | row metadata, see [rows section](/dashboard/#rows) for details | +| **rows** | row metadata, see [rows section](/dashboard.md/#rows) for details | | **time** | time range for dashboard, i.e. last 6 hours, last 7 days, etc | -| **timepicker** | timepicker metadata, see [timepicker section](/dashboard/#timepicker) for details | -| **templating** | templating metadata, see [templating section](/dashboard/#templating) for details | -| **annotations** | annotations metadata, see [annotations section](/dashboard/#annotations) for details | +| **timepicker** | timepicker metadata, see [timepicker section](/dashboard.md/#timepicker) for details | +| **templating** | templating metadata, see [templating section](/dashboard.md/#templating) for details | +| **annotations** | annotations metadata, see [annotations section](/dashboard.md/#annotations) for details | | **schemaVersion** | TODO | | **version** | TODO | | **links** | TODO | @@ -105,7 +105,7 @@ Usage of the fields is explained below: | **collapse** | whether row is collapsed or not | | **editable** | whether a row is editable or not | | **height** | height of the row in pixels | -| **panels** | panels metadata, see [panels section](/dashboard/#panels) for details | +| **panels** | panels metadata, see [panels section](/dashboard.md/#panels) for details | | **title** | title of row | #### panels From 74b10a42ee66f3fa682ea139be8f560725b2f871 Mon Sep 17 00:00:00 2001 From: Utkarsh Bhatnagar Date: Mon, 2 Nov 2015 10:29:42 -0800 Subject: [PATCH 17/22] Fixed broken links in the doc page --- docs/sources/reference/dashboard.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/sources/reference/dashboard.md b/docs/sources/reference/dashboard.md index 60064690fb2..5b18b9e26ad 100644 --- a/docs/sources/reference/dashboard.md +++ b/docs/sources/reference/dashboard.md @@ -66,11 +66,11 @@ Each field in the dashboard JSON is explained below with its usage: | **editable** | whether a dashboard is editable or not | | **hideControls** | whether row controls on the left in green are hidden or not | | **sharedCrosshair** | TODO | -| **rows** | row metadata, see [rows section](/dashboard.md/#rows) for details | +| **rows** | row metadata, see [rows section](/docs/sources/reference/dashboard.md/#rows) for details | | **time** | time range for dashboard, i.e. last 6 hours, last 7 days, etc | -| **timepicker** | timepicker metadata, see [timepicker section](/dashboard.md/#timepicker) for details | -| **templating** | templating metadata, see [templating section](/dashboard.md/#templating) for details | -| **annotations** | annotations metadata, see [annotations section](/dashboard.md/#annotations) for details | +| **timepicker** | timepicker metadata, see [timepicker section](/docs/sources/reference/dashboard.md/#timepicker) for details | +| **templating** | templating metadata, see [templating section](/docs/sources/reference/dashboard.md/#templating) for details | +| **annotations** | annotations metadata, see [annotations section](/docs/sources/reference/dashboard.md/#annotations) for details | | **schemaVersion** | TODO | | **version** | TODO | | **links** | TODO | @@ -105,7 +105,7 @@ Usage of the fields is explained below: | **collapse** | whether row is collapsed or not | | **editable** | whether a row is editable or not | | **height** | height of the row in pixels | -| **panels** | panels metadata, see [panels section](/dashboard.md/#panels) for details | +| **panels** | panels metadata, see [panels section](/docs/sources/reference/dashboard.md/#panels) for details | | **title** | title of row | #### panels From 2676f24e0a09040331d49c391cb774ca447a8b11 Mon Sep 17 00:00:00 2001 From: utkarshcmu Date: Fri, 6 Nov 2015 20:17:27 -0800 Subject: [PATCH 18/22] Fixed user deletion in Postgres SQL --- pkg/services/sqlstore/user.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pkg/services/sqlstore/user.go b/pkg/services/sqlstore/user.go index 6c6f581dcc4..cf39199c1da 100644 --- a/pkg/services/sqlstore/user.go +++ b/pkg/services/sqlstore/user.go @@ -319,10 +319,15 @@ func SearchUsers(query *m.SearchUsersQuery) error { func DeleteUser(cmd *m.DeleteUserCommand) error { return inTransaction(func(sess *xorm.Session) error { - deletes := []string{ - "DELETE FROM star WHERE user_id = ?", - "DELETE FROM user WHERE id = ?", - } + var deletes [2]string + + if (sess.Engine.DriverName() == "postgres") { + deletes[0] = "DELETE FROM star WHERE user_id = ?" + deletes[1] = "DELETE FROM \"user\" WHERE id = ?" + } else { + deletes[0] = "DELETE FROM star WHERE user_id = ?" + deletes[1] = "DELETE FROM user WHERE id = ?" + } for _, sql := range deletes { _, err := sess.Exec(sql, cmd.UserId) From fe2d8f1ea0175b3c3b6e6868b26286f56277648c Mon Sep 17 00:00:00 2001 From: utkarshcmu Date: Sat, 7 Nov 2015 05:21:22 -0800 Subject: [PATCH 19/22] Used dialect for postgres --- pkg/services/sqlstore/user.go | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/pkg/services/sqlstore/user.go b/pkg/services/sqlstore/user.go index cf39199c1da..96b8c24b8fc 100644 --- a/pkg/services/sqlstore/user.go +++ b/pkg/services/sqlstore/user.go @@ -319,15 +319,10 @@ func SearchUsers(query *m.SearchUsersQuery) error { func DeleteUser(cmd *m.DeleteUserCommand) error { return inTransaction(func(sess *xorm.Session) error { - var deletes [2]string - - if (sess.Engine.DriverName() == "postgres") { - deletes[0] = "DELETE FROM star WHERE user_id = ?" - deletes[1] = "DELETE FROM \"user\" WHERE id = ?" - } else { - deletes[0] = "DELETE FROM star WHERE user_id = ?" - deletes[1] = "DELETE FROM user WHERE id = ?" - } + deletes := []string{ + "DELETE FROM star WHERE user_id = ?", + "DELETE FROM " + dialect.Quote("user") + " WHERE id = ?", + } for _, sql := range deletes { _, err := sess.Exec(sql, cmd.UserId) From efc0b60d4122f1b40a1ea5df520f7ec023c67b03 Mon Sep 17 00:00:00 2001 From: utkarshcmu Date: Sun, 8 Nov 2015 21:44:58 -0800 Subject: [PATCH 20/22] Fixed opentsdb queryctrl uncheck Rate UI bug --- .../datasource/opentsdb/partials/query.editor.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/app/plugins/datasource/opentsdb/partials/query.editor.html b/public/app/plugins/datasource/opentsdb/partials/query.editor.html index f2fc4afb181..5cd4fd4f283 100644 --- a/public/app/plugins/datasource/opentsdb/partials/query.editor.html +++ b/public/app/plugins/datasource/opentsdb/partials/query.editor.html @@ -162,20 +162,20 @@ -
  • +
  • Counter Max:
  • -
  • +
  • -
  • +
  • Reset Value:
  • -
  • +
  • Date: Mon, 9 Nov 2015 00:28:16 -0800 Subject: [PATCH 21/22] Added missing AWS Regions --- pkg/api/cloudwatch/metrics.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/api/cloudwatch/metrics.go b/pkg/api/cloudwatch/metrics.go index 6d6ff10dfb9..bc21da81f44 100644 --- a/pkg/api/cloudwatch/metrics.go +++ b/pkg/api/cloudwatch/metrics.go @@ -67,8 +67,8 @@ func init() { func handleGetRegions(req *cwRequest, c *middleware.Context) { regions := []string{ - "us-west-2", "us-west-1", "eu-west-1", "eu-central-1", "ap-southeast-1", - "ap-southeast-2", "ap-northeast-1", "sa-east-1", + "us-east-1", "us-west-2", "us-west-1", "eu-west-1", "eu-central-1", "ap-southeast-1", + "ap-southeast-2", "ap-northeast-1", "sa-east-1", "cn-north-1", } result := []interface{}{} From 88d27fe649a0d312c57581237b2ed1fcdb015e78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 9 Nov 2015 09:48:02 +0100 Subject: [PATCH 22/22] log(color): disabled console log formating by default --- conf/defaults.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/defaults.ini b/conf/defaults.ini index 69d045dc4ae..8b2b34f3fbc 100644 --- a/conf/defaults.ini +++ b/conf/defaults.ini @@ -225,7 +225,7 @@ level = Info [log.console] level = # Set formatting to "false" to disable color formatting of console logs -formatting = true +formatting = false # For "file" mode only [log.file]