annotations.editor.html 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <div class="gf-form-group">
  2. <div class="gf-form-inline">
  3. <div class="gf-form gf-form--grow">
  4. <textarea
  5. rows="10"
  6. class="gf-form-input"
  7. ng-model="ctrl.annotation.rawQuery"
  8. spellcheck="false"
  9. placeholder="query expression"
  10. data-min-length="0"
  11. data-items="100"
  12. ng-model-onblur
  13. ng-change="ctrl.panelCtrl.refresh()"
  14. ></textarea>
  15. </div>
  16. </div>
  17. <div class="gf-form-inline">
  18. <div class="gf-form">
  19. <label class="gf-form-label query-keyword" ng-click="ctrl.showHelp = !ctrl.showHelp">
  20. Show Help
  21. <icon name="'angle-down'" ng-show="ctrl.showHelp" style="margin-top: 3px;"></icon>
  22. <icon name="'angle-right'" ng-hide="ctrl.showHelp" style="margin-top: 3px;"></icon>
  23. </label>
  24. </div>
  25. </div>
  26. <div class="gf-form" ng-show="ctrl.showHelp">
  27. <pre class="gf-form-pre alert alert-info"><h6>Annotation Query Format</h6>
  28. An annotation is an event that is overlaid on top of graphs. The query can have up to four columns per row, the <b>time</b> column is mandatory. Annotation rendering is expensive so it is important to limit the number of rows returned.
  29. - column with alias: <b>time</b> for the annotation event time. Use epoch time or any native date data type.
  30. - column with alias: <b>timeend</b> for the annotation event end time. Use epoch time or any native date data type.
  31. - column with alias: <b>text</b> for the annotation text.
  32. - column with alias: <b>tags</b> for annotation tags. This is a comma separated string of tags e.g. 'tag1,tag2'.
  33. Macros:
  34. - $__time(column) -&gt; column AS time
  35. - $__timeEpoch(column) -&gt; DATEDIFF(second, '1970-01-01', column) AS time
  36. - $__timeFilter(column) -&gt; column BETWEEN '2017-04-21T05:01:17Z' AND '2017-04-21T05:01:17Z'
  37. - $__unixEpochFilter(column) -&gt; column &gt;= 1492750877 AND column &lt;= 1492750877
  38. - $__unixEpochNanoFilter(column) -&gt; column &gt;= 1494410783152415214 AND column &lt;= 1494497183142514872
  39. Or build your own conditionals using these macros which just return the values:
  40. - $__timeFrom() -&gt; '2017-04-21T05:01:17Z'
  41. - $__timeTo() -&gt; '2017-04-21T05:01:17Z'
  42. - $__unixEpochFrom() -&gt; 1492750877
  43. - $__unixEpochTo() -&gt; 1492750877
  44. - $__unixEpochNanoFrom() -&gt; 1494410783152415214
  45. - $__unixEpochNanoTo() -&gt; 1494497183142514872
  46. </pre>
  47. </div>
  48. </div>