annotations.editor.html 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. <div class="grafana-info-box">
  28. <pre class="pre--no-style"><h6>Annotation Query Format</h6>
  29. An annotation is an event that is overlaid on top of graphs. The query can have up to four columns per row, the time column is mandatory. Annotation rendering is expensive so it is important to limit the number of rows returned.
  30. - column with alias: <b>time</b> for the annotation event time. Use epoch time or any native date data type.
  31. - column with alias: <b>timeend</b> for the annotation event time-end. Use epoch time or any native date data type.
  32. - column with alias: <b>text</b> for the annotation text
  33. - column with alias: <b>tags</b> for annotation tags. This is a comma separated string of tags e.g. 'tag1,tag2'
  34. Macros:
  35. - $__time(column) -&gt; column as "time"
  36. - $__timeEpoch -&gt; extract(epoch from column) as "time"
  37. - $__timeFilter(column) -&gt; column BETWEEN '2017-04-21T05:01:17Z' AND '2017-04-21T05:01:17Z'
  38. - $__unixEpochFilter(column) -&gt; column &gt;= 1492750877 AND column &lt;= 1492750877
  39. - $__unixEpochNanoFilter(column) -&gt; column &gt;= 1494410783152415214 AND column &lt;= 1494497183142514872
  40. Or build your own conditionals using these macros which just return the values:
  41. - $__timeFrom() -&gt; '2017-04-21T05:01:17Z'
  42. - $__timeTo() -&gt; '2017-04-21T05:01:17Z'
  43. - $__unixEpochFrom() -&gt; 1492750877
  44. - $__unixEpochTo() -&gt; 1492750877
  45. - $__unixEpochNanoFrom() -&gt; 1494410783152415214
  46. - $__unixEpochNanoTo() -&gt; 1494497183142514872
  47. </pre>
  48. </div>
  49. </div>
  50. </div>