Просмотр исходного кода

Changed opentsdb metric option chartLabel to Alias to better conform to grafana naming, updated changelog with PR #618 info

Torkel Ödegaard 11 лет назад
Родитель
Сommit
923cd045cd

+ 1 - 0
CHANGELOG.md

@@ -16,6 +16,7 @@
 - [Issue #556](https://github.com/grafana/grafana/issues/556). Chart: New legend display option "Right side", will show legend to the right of the graph
 - [Issue #604](https://github.com/grafana/grafana/issues/604). Chart: New axis format, 'bps' (SI unit in steps of 1000) useful for network gear metics
 - [Issue #626](https://github.com/grafana/grafana/issues/626). Chart: Downscale y axis to more precise unit, value of 0.1 for seconds format will be formated as 100 ms. Thanks @kamaradclimber
+- [Issue #618](https://github.com/grafana/grafana/issues/618). OpenTSDB: Series alias option to override metric name returned from opentsdb. Thanks @heldr
 
 **Changes**
 - [Issue #536](https://github.com/grafana/grafana/issues/536). Graphite: Use unix epoch for Graphite from/to for absolute time ranges

+ 16 - 11
src/app/partials/opentsdb/editor.html

@@ -57,18 +57,9 @@
               <i class="icon-warning-sign"></i>
             </a>
           </li>
-          <li>
-            <input type="text"
-                   class="grafana-target-segment-input"
-                   ng-model="target.chartLabel"
-                   spellcheck='false'
-                   placeholder="chart label(optional)"
-                   data-min-length=0 data-items=100
-                   ng-blur="targetBlur()"
-                   />
-          </li>
-          <li class="grafana-target-segment">
+					<li class="grafana-target-segment">
             Aggregator
+          </li>
           <li>
             <select ng-model="target.aggregator"
                     class="grafana-target-segment-input input-small"
@@ -98,6 +89,20 @@
                    ng-model="target.isCounter"
                    ng-change="targetBlur()">
           </li>
+          <li class="grafana-target-segment">
+            Alias:
+          </li>
+					<li>
+						<input type="text"
+                   class="grafana-target-segment-input input-medium"
+                   ng-model="target.alias"
+                   spellcheck='false'
+                   placeholder="series alias"
+                   data-min-length=0 data-items=100
+                   ng-blur="targetBlur()"
+                   />
+          </li>
+
         </ul>
 
         <div class="clearfix"></div>

+ 3 - 2
src/app/services/opentsdb/opentsdbDatasource.js

@@ -15,6 +15,7 @@ function (angular, _, kbn) {
       this.editorSrc = 'app/partials/opentsdb/editor.html';
       this.url = datasource.url;
       this.name = datasource.name;
+      this.supportMetrics = true;
     }
 
     // Called once per panel (graph)
@@ -105,8 +106,8 @@ function (angular, _, kbn) {
     }
 
     function createMetricLabel(metric, tagData, options) {
-      if (options.chartLabel) {
-        return options.chartLabel;
+      if (options.alias) {
+        return options.alias;
       }
 
       if (!_.isEmpty(tagData)) {