editor.html 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. <div class="editor-row">
  2. <div ng-repeat="target in panel.targets"
  3. class="grafana-target"
  4. ng-class="{'grafana-target-hidden': target.hide}"
  5. ng-controller="InfluxTargetCtrl"
  6. ng-init="init()">
  7. <div class="grafana-target-inner-wrapper">
  8. <div class="grafana-target-inner">
  9. <ul class="grafana-target-controls">
  10. <li class="dropdown">
  11. <a class="pointer dropdown-toggle"
  12. data-toggle="dropdown"
  13. tabindex="1">
  14. <i class="icon icon-cog"></i>
  15. </a>
  16. <ul class="dropdown-menu pull-right" role="menu">
  17. <li role="menuitem">
  18. <a tabindex="1" ng-click="duplicate()">Duplicate</a>
  19. <a tabindex="2" ng-click="showQuery()" ng-hide="target.rawQuery">Raw query mode</a>
  20. <a tabindex="2" ng-click="hideQuery()" ng-show="target.rawQuery">Query editor mode</a>
  21. </li>
  22. </ul>
  23. </li>
  24. <li>
  25. <a class="pointer" tabindex="1" ng-click="removeDataQuery(target)">
  26. <i class="icon icon-remove"></i>
  27. </a>
  28. </li>
  29. </ul>
  30. <ul class="grafana-segment-list">
  31. <li>
  32. <a class="grafana-target-segment" ng-click="target.hide = !target.hide; get_data();" role="menuitem">
  33. <i class="icon-eye-open"></i>
  34. </a>
  35. </li>
  36. </ul>
  37. <!-- Raw Query mode -->
  38. <ul class="grafana-segment-list" ng-show="target.rawQuery">
  39. <li>
  40. <input type="text"
  41. class="grafana-target-text-input span10"
  42. ng-model="target.query"
  43. placeholder="select ..."
  44. focus-me="target.rawQuery"
  45. spellcheck='false'
  46. data-min-length=0 data-items=100
  47. ng-model-onblur
  48. ng-blur="get_data()">
  49. </li>
  50. </ul>
  51. <!-- Query editor mode -->
  52. <ul class="grafana-segment-list" role="menu" ng-hide="target.rawQuery">
  53. <li class="grafana-target-segment">
  54. series
  55. </li>
  56. <li>
  57. <input type="text"
  58. class="grafana-target-text-input span8"
  59. ng-model="target.series"
  60. spellcheck='false'
  61. bs-typeahead="listSeries"
  62. placeholder="series name"
  63. data-min-length=0 data-items=100
  64. ng-blur="seriesBlur()">
  65. </li>
  66. <li class="grafana-target-segment">
  67. alias
  68. </li>
  69. <li>
  70. <input type="text" class="input-medium grafana-target-text-input" ng-model="target.alias"
  71. spellcheck='false' placeholder="alias" ng-blur="get_data()">
  72. </li>
  73. </ul>
  74. <div class="clearfix"></div>
  75. </div>
  76. <div class="grafana-target-inner">
  77. <!-- Raw Query mode -->
  78. <ul class="grafana-segment-list" ng-show="target.rawQuery">
  79. <li class="grafana-target-segment">
  80. <i class="icon-eye-open invisible"></i>
  81. </li>
  82. <li class="grafana-target-segment">
  83. alias
  84. </li>
  85. <li>
  86. <input type="text"
  87. class="input-medium grafana-target-text-input"
  88. ng-model="target.alias"
  89. spellcheck='false'
  90. placeholder="alias"
  91. ng-blur="get_data()">
  92. </li>
  93. <li class="grafana-target-segment">
  94. group by time
  95. </li>
  96. <li>
  97. <input type="text" class="input-mini grafana-target-text-input" ng-model="target.interval"
  98. spellcheck='false' placeholder="{{interval}}" data-placement="right"
  99. bs-tooltip="'Leave blank for auto handling based on time range and panel width'"
  100. ng-model-onblur ng-change="get_data()" >
  101. </li>
  102. </ul>
  103. <!-- Query editor mode -->
  104. <ul class="grafana-segment-list" role="menu" ng-hide="target.rawQuery">
  105. <li class="grafana-target-segment">
  106. <i class="icon-eye-open invisible"></i>
  107. </li>
  108. <li class="grafana-target-segment">
  109. select
  110. </li>
  111. <li class="dropdown">
  112. <span influxdb-func-editor class="grafana-target-segment">
  113. </span>
  114. </li>
  115. <li class="grafana-target-segment">
  116. where
  117. </li>
  118. <li>
  119. <input type="text" class="input-medium grafana-target-text-input" ng-model="target.condition"
  120. bs-tooltip="'Add a where clause'" data-placement="right" spellcheck='false' placeholder="column ~= value" ng-blur="get_data()">
  121. </li>
  122. <li class="grafana-target-segment">
  123. group by time
  124. </li>
  125. <li>
  126. <input type="text" class="input-mini grafana-target-text-input" ng-model="target.interval"
  127. spellcheck='false' placeholder="{{interval}}" data-placement="right"
  128. bs-tooltip="'Leave blank for auto handling based on time range and panel width'"
  129. ng-model-onblur ng-change="get_data()" >
  130. </li>
  131. <li class="grafana-target-segment">
  132. <i class="icon-plus"></i>
  133. </li>
  134. <li>
  135. <input type="text" class="input-small grafana-target-text-input" ng-model="target.groupby_field" bs-tooltip="'Add a group by column or leave blank'"
  136. placeholder="column" spellcheck="false" bs-typeahead="listColumns" data-min-length=0 ng-blur="get_data()">
  137. </li>
  138. <li class="dropdown">
  139. <a class="grafana-target-segment pointer" data-toggle="dropdown" bs-tooltip="'Insert missing values, important when stacking'" data-placement="right">
  140. <span ng-show="target.fill">
  141. fill ({{target.fill}})
  142. </span>
  143. <span ng-show="!target.fill">
  144. no fill
  145. </span>
  146. </a>
  147. <ul class="dropdown-menu">
  148. <li><a ng-click="target.fill = ''">no fill</a></li>
  149. <li><a ng-click="target.fill = 'null'">fill (null)</a></li>
  150. <li><a ng-click="target.fill = '0'">fill (0)</a></li>
  151. </ul>
  152. </li>
  153. </ul>
  154. <div class="clearfix"></div>
  155. </div>
  156. </div>
  157. </div>
  158. </div>
  159. <section class="grafana-metric-options">
  160. <div class="grafana-target">
  161. <div class="grafana-target-inner">
  162. <ul class="grafana-segment-list">
  163. <li class="grafana-target-segment grafana-target-segment-icon">
  164. <i class="icon-wrench"></i>
  165. </li>
  166. <li class="grafana-target-segment">
  167. group by time
  168. </li>
  169. <li>
  170. <input type="text" class="input-medium grafana-target-text-input" ng-model="panel.interval" ng-blur="get_data();"
  171. spellcheck='false' placeholder="example: >10s">
  172. </li>
  173. <li class="grafana-target-segment">
  174. <i class="icon-question-sign" bs-tooltip="'Set a low limit by having a greater sign: example: >60s'" data-placement="right"></i>
  175. </li>
  176. </ul>
  177. <div class="clearfix"></div>
  178. </div>
  179. <div class="grafana-target-inner">
  180. <ul class="grafana-segment-list">
  181. <li class="grafana-target-segment grafana-target-segment-icon">
  182. <i class="icon-info-sign"></i>
  183. </li>
  184. <li class="grafana-target-segment">
  185. <a ng-click="toggleEditorHelp(1);" bs-tooltip="'click to show helpful info'" data-placement="bottom">
  186. alias patterns
  187. </a>
  188. </li>
  189. <li class="grafana-target-segment">
  190. <a ng-click="toggleEditorHelp(2)" bs-tooltip="'click to show helpful info'" data-placement="bottom">
  191. stacking &amp; and fill
  192. </a>
  193. </li>
  194. <li class="grafana-target-segment">
  195. <a ng-click="toggleEditorHelp(3)" bs-tooltip="'click to show helpful info'" data-placement="bottom">
  196. group by time
  197. </a>
  198. </li>
  199. </ul>
  200. <div class="clearfix"></div>
  201. </div>
  202. </div>
  203. </section>
  204. <div class="editor-row">
  205. <div class="pull-left" style="margin-top: 30px;">
  206. <div class="grafana-info-box span6" ng-if="editorHelpIndex === 1">
  207. <h5>Alias patterns</h5>
  208. <ul>
  209. <li>$s = series name</li>
  210. <li>$g = group by</li>
  211. <li>$[0-9] part of series name for series names seperated by dots.</li>
  212. </ul>
  213. </div>
  214. <div class="grafana-info-box span6" ng-if="editorHelpIndex === 2">
  215. <h5>Stacking and fill</h5>
  216. <ul>
  217. <li>When stacking is enabled it important that points align</li>
  218. <li>If there are missing points for one series it can cause gaps or missing bars</li>
  219. <li>You must use fill(0), and select a group by time low limit</li>
  220. <li>Use the group by time option below your queries and specify for example &gt;10s if your metrics are written every 10 seconds</li>
  221. <li>This will insert zeros for series that are missing measurements and will make stacking work properly</li>
  222. </ul>
  223. </div>
  224. <div class="grafana-info-box span6" ng-if="editorHelpIndex === 3">
  225. <h5>Group by time</h5>
  226. <ul>
  227. <li>Group by time is important, otherwise the query could return many thousands of datapoints that will slow down Grafana</li>
  228. <li>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</li>
  229. <li>If you use fill(0) or fill(null) set a low limit for the auto group by time interval</li>
  230. <li>The low limit can only be set in the group by time option below your queries</li>
  231. <li>You set a low limit by adding a greater sign before the interval</li>
  232. <li>Example: &gt;60s if you write metrics to InfluxDB every 60 seconds</li>
  233. </ul>
  234. </div>
  235. </div>
  236. </div>