From d3e307b102e136cba1e47dc5f85bc80e58294ffe Mon Sep 17 00:00:00 2001 From: Adam Heinz Date: Mon, 31 Aug 2015 09:32:47 -0400 Subject: [PATCH] Refactor post-rebase to configure directives. --- .../datasource/elasticsearch/directives.js | 8 ++ .../elasticsearch/partials/query.editor.html | 87 ------------------- .../elasticsearch/partials/query.options.html | 86 ++++++++++++++++++ .../datasource/elasticsearch/plugin.json | 1 - 4 files changed, 94 insertions(+), 88 deletions(-) create mode 100644 public/app/plugins/datasource/elasticsearch/partials/query.options.html diff --git a/public/app/plugins/datasource/elasticsearch/directives.js b/public/app/plugins/datasource/elasticsearch/directives.js index 8ab75f8e4ad..2d6825a70c7 100644 --- a/public/app/plugins/datasource/elasticsearch/directives.js +++ b/public/app/plugins/datasource/elasticsearch/directives.js @@ -6,6 +6,14 @@ function (angular) { var module = angular.module('grafana.directives'); + module.directive('metricQueryEditorElasticsearch', function() { + return {controller: 'ElasticQueryCtrl', templateUrl: 'app/plugins/datasource/elasticsearch/partials/query.editor.html'}; + }); + + module.directive('metricQueryOptionsElasticsearch', function() { + return {templateUrl: 'app/plugins/datasource/elasticsearch/partials/query.options.html'}; + }); + module.directive('annotationsQueryEditorElasticsearch', function() { return {templateUrl: 'app/plugins/datasource/elasticsearch/partials/annotations.editor.html'}; }); diff --git a/public/app/plugins/datasource/elasticsearch/partials/query.editor.html b/public/app/plugins/datasource/elasticsearch/partials/query.editor.html index 63abb5f1f76..84028675ce5 100644 --- a/public/app/plugins/datasource/elasticsearch/partials/query.editor.html +++ b/public/app/plugins/datasource/elasticsearch/partials/query.editor.html @@ -149,90 +149,3 @@ - -
-
-
    -
  • - -
  • -
  • - Group by time interval -
  • -
  • - -
  • -
  • - -
  • -
-
-
- - -
- -
-
- -
-
Alias patterns
-
    -
  • $m = replaced with measurement name
  • -
  • $measurement = replaced with measurement name
  • -
  • $tag_hostname = replaced with the value of the hostname tag
  • -
  • You can also use [[tag_hostname]] pattern replacement syntax
  • -
-
- -
-
Stacking and fill
-
    -
  • When stacking is enabled it important that points align
  • -
  • If there are missing points for one series it can cause gaps or missing bars
  • -
  • You must use fill(0), and select a group by time low limit
  • -
  • Use the group by time option below your queries and specify for example >10s if your metrics are written every 10 seconds
  • -
  • This will insert zeros for series that are missing measurements and will make stacking work properly
  • -
-
- -
-
Group by time
-
    -
  • Group by time is important, otherwise the query could return many thousands of datapoints that will slow down Grafana
  • -
  • Leave the group by time field empty for each query and it will be calculated based on time range and pixel width of the graph
  • -
  • If you use fill(0) or fill(null) set a low limit for the auto group by time interval
  • -
  • The low limit can only be set in the group by time option below your queries
  • -
  • You set a low limit by adding a greater sign before the interval
  • -
  • Example: >60s if you write metrics to ElasticDB every 60 seconds
  • -
-
- - -
-
- - diff --git a/public/app/plugins/datasource/elasticsearch/partials/query.options.html b/public/app/plugins/datasource/elasticsearch/partials/query.options.html new file mode 100644 index 00000000000..934b9a77079 --- /dev/null +++ b/public/app/plugins/datasource/elasticsearch/partials/query.options.html @@ -0,0 +1,86 @@ +
+
+
    +
  • + +
  • +
  • + Group by time interval +
  • +
  • + +
  • +
  • + +
  • +
+
+
+ + +
+ +
+
+ +
+
Alias patterns
+
    +
  • $m = replaced with measurement name
  • +
  • $measurement = replaced with measurement name
  • +
  • $tag_hostname = replaced with the value of the hostname tag
  • +
  • You can also use [[tag_hostname]] pattern replacement syntax
  • +
+
+ +
+
Stacking and fill
+
    +
  • When stacking is enabled it important that points align
  • +
  • If there are missing points for one series it can cause gaps or missing bars
  • +
  • You must use fill(0), and select a group by time low limit
  • +
  • Use the group by time option below your queries and specify for example >10s if your metrics are written every 10 seconds
  • +
  • This will insert zeros for series that are missing measurements and will make stacking work properly
  • +
+
+ +
+
Group by time
+
    +
  • Group by time is important, otherwise the query could return many thousands of datapoints that will slow down Grafana
  • +
  • Leave the group by time field empty for each query and it will be calculated based on time range and pixel width of the graph
  • +
  • If you use fill(0) or fill(null) set a low limit for the auto group by time interval
  • +
  • The low limit can only be set in the group by time option below your queries
  • +
  • You set a low limit by adding a greater sign before the interval
  • +
  • Example: >60s if you write metrics to ElasticDB every 60 seconds
  • +
+
+ + +
+
+ + diff --git a/public/app/plugins/datasource/elasticsearch/plugin.json b/public/app/plugins/datasource/elasticsearch/plugin.json index 5a0ca88fba4..bd467222a93 100644 --- a/public/app/plugins/datasource/elasticsearch/plugin.json +++ b/public/app/plugins/datasource/elasticsearch/plugin.json @@ -9,7 +9,6 @@ "partials": { "config": "app/plugins/datasource/elasticsearch/partials/config.html", - "query": "app/plugins/datasource/elasticsearch/partials/query.editor.html", "annotations": "app/plugins/datasource/elasticsearch/partials/annotations.editor.html" },