query.editor.html 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <div class="editor-row">
  2. <div ng-repeat="target in panel.targets"
  3. class="tight-form"
  4. ng-class="{'tight-form-disabled': target.hide}"
  5. ng-controller="GraphiteQueryCtrl"
  6. ng-init="init()">
  7. <ul class="tight-form-list pull-right">
  8. <li ng-show="parserError" class="tight-form-item">
  9. <a bs-tooltip="parserError" style="color: rgb(229, 189, 28)" role="menuitem">
  10. <i class="fa fa-warning"></i>
  11. </a>
  12. </li>
  13. <li class="tight-form-item">
  14. <a class="pointer" tabindex="1" ng-click="toggleEditorMode()">
  15. <i class="fa fa-pencil"></i>
  16. </a>
  17. </li>
  18. <li class="tight-form-item">
  19. <div class="dropdown">
  20. <a class="pointer dropdown-toggle"
  21. data-toggle="dropdown"
  22. tabindex="1">
  23. <i class="fa fa-bars"></i>
  24. </a>
  25. <ul class="dropdown-menu pull-right" role="menu">
  26. <li role="menuitem">
  27. <a tabindex="1"
  28. ng-click="duplicate()">
  29. Duplicate
  30. </a>
  31. </li>
  32. <li role="menuitem">
  33. <a tabindex="1"
  34. ng-click="moveMetricQuery($index, $index-1)">
  35. Move up
  36. </a>
  37. </li>
  38. <li role="menuitem">
  39. <a tabindex="1"
  40. ng-click="moveMetricQuery($index, $index+1)">
  41. Move down
  42. </a>
  43. </li>
  44. </ul>
  45. </div>
  46. </li>
  47. <li class="tight-form-item last">
  48. <a class="pointer" tabindex="1" ng-click="removeDataQuery(target)">
  49. <i class="fa fa-remove"></i>
  50. </a>
  51. </li>
  52. </ul>
  53. <ul class="tight-form-list">
  54. <li class="tight-form-item" style="min-width: 15px; text-align: center">
  55. {{targetLetters[$index]}}
  56. </li>
  57. <li>
  58. <a class="tight-form-item"
  59. ng-click="target.hide = !target.hide; get_data();"
  60. role="menuitem">
  61. <i class="fa fa-eye"></i>
  62. </a>
  63. </li>
  64. </ul>
  65. <input type="text" class="tight-form-clear-input span10"
  66. ng-model="target.target"
  67. focus-me="target.textEditor"
  68. spellcheck='false'
  69. ng-model-onblur ng-change="get_data()"
  70. ng-show="target.textEditor" />
  71. <ul class="tight-form-list" role="menu" ng-hide="target.textEditor">
  72. <li ng-repeat="segment in segments" role="menuitem">
  73. <metric-segment segment="segment" get-alt-segments="getAltSegments($index)" on-value-changed="segmentValueChanged(segment, $index)"></metric-segment>
  74. </li>
  75. <li ng-repeat="func in functions">
  76. <span graphite-func-editor class="tight-form-item tight-form-func">
  77. </span>
  78. </li>
  79. <li class="dropdown" graphite-add-func>
  80. </li>
  81. </ul>
  82. <div class="clearfix"></div>
  83. </div>
  84. </div>
  85. <section class="grafana-metric-options">
  86. <div class="tight-form">
  87. <ul class="tight-form-list">
  88. <li class="tight-form-item tight-form-item-icon">
  89. <i class="fa fa-wrench"></i>
  90. </li>
  91. <li class="tight-form-item">
  92. Cache timeout
  93. </li>
  94. <li>
  95. <input type="text"
  96. class="input-mini tight-form-input"
  97. ng-model="panel.cacheTimeout"
  98. bs-tooltip="'Graphite parameter to override memcache default timeout (unit is seconds)'"
  99. data-placement="right"
  100. spellcheck='false'
  101. placeholder="60">
  102. </li>
  103. <li class="tight-form-item">
  104. Max data points
  105. </li>
  106. <li>
  107. <input type="text"
  108. class="input-mini tight-form-input"
  109. ng-model="panel.maxDataPoints"
  110. bs-tooltip="'Override max data points, automatically set to graph width in pixels.'"
  111. data-placement="right"
  112. ng-model-onblur ng-change="get_data()"
  113. spellcheck='false'
  114. placeholder="auto">
  115. </li>
  116. </ul>
  117. <div class="clearfix"></div>
  118. </div>
  119. <div class="tight-form">
  120. <ul class="tight-form-list">
  121. <li class="tight-form-item tight-form-item-icon">
  122. <i class="fa fa-info-circle"></i>
  123. </li>
  124. <li class="tight-form-item">
  125. <a ng-click="toggleEditorHelp(1);" bs-tooltip="'click to show helpful info'" data-placement="bottom">
  126. shorter legend names
  127. </a>
  128. </li>
  129. <li class="tight-form-item">
  130. <a ng-click="toggleEditorHelp(2);" bs-tooltip="'click to show helpful info'" data-placement="bottom">
  131. series as parameters
  132. </a>
  133. </li>
  134. <li class="tight-form-item">
  135. <a ng-click="toggleEditorHelp(3)" bs-tooltip="'click to show helpful info'" data-placement="bottom">
  136. stacking
  137. </a>
  138. </li>
  139. <li class="tight-form-item">
  140. <a ng-click="toggleEditorHelp(4)" bs-tooltip="'click to show helpful info'" data-placement="bottom">
  141. templating
  142. </a>
  143. </li>
  144. <li class="tight-form-item">
  145. <a ng-click="toggleEditorHelp(5)" bs-tooltip="'click to show helpful info'" data-placement="bottom">
  146. max data points
  147. </a>
  148. </li>
  149. </ul>
  150. <div class="clearfix"></div>
  151. </div>
  152. </section>
  153. <div class="editor-row">
  154. <div class="pull-left" style="margin-top: 30px;">
  155. <div class="grafana-info-box span8" ng-if="editorHelpIndex === 1">
  156. <h5>Shorter legend names</h5>
  157. <ul>
  158. <li>alias() function to specify a custom series name</li>
  159. <li>aliasByNode(2) to alias by a specific part of your metric path</li>
  160. <li>aliasByNode(2, -1) you can add multiple segment paths, and use negative index</li>
  161. <li>groupByNode(2, 'sum') is useful if you have 2 wildcards in your metric path and want to sumSeries and group by</li>
  162. </ul>
  163. </div>
  164. <div class="grafana-info-box span8" ng-if="editorHelpIndex === 2">
  165. <h5>Series as parameter</h5>
  166. <ul>
  167. <li>Some graphite functions allow you to have many series arguments</li>
  168. <li>Use #[A-Z] to use a graphite query as parameter to a function</li>
  169. <li>
  170. Examples:
  171. <ul>
  172. <li>asPercent(#A, #B)</li>
  173. <li>prod.srv-01.counters.count - asPercent(#A) : percentage of count in comparison with A query</li>
  174. <li>prod.srv-01.counters.count - sumSeries(#A) : sum count and series A </li>
  175. <li>divideSeries(#A, #B)</li>
  176. </ul>
  177. </li>
  178. <li>If a query is added only to be used as a parameter, hide it from the graph with the eye icon</li>
  179. </ul>
  180. </div>
  181. <div class="grafana-info-box span6" ng-if="editorHelpIndex === 3">
  182. <h5>Stacking</h5>
  183. <ul>
  184. <li>You find the stacking option under Display Styles tab</li>
  185. <li>When stacking is enabled make sure null point mode is set to 'null as zero'</li>
  186. </ul>
  187. </div>
  188. <div class="grafana-info-box span6" ng-if="editorHelpIndex === 4">
  189. <h5>Templating</h5>
  190. <ul>
  191. <li>You can use a template variable in place of metric names</li>
  192. <li>You can use a template variable in place of function parameters</li>
  193. <li>You enable the templating feature in Dashboard settings / Feature toggles </li>
  194. </ul>
  195. </div>
  196. <div class="grafana-info-box span6" ng-if="editorHelpIndex === 5">
  197. <h5>Max data points</h5>
  198. <ul>
  199. <li>Every graphite request is issued with a maxDataPoints parameter</li>
  200. <li>Graphite uses this parameter to consolidate the real number of values down to this number</li>
  201. <li>If there are more real values, then by default they will be consolidated using averages</li>
  202. <li>This could hide real peaks and max values in your series</li>
  203. <li>You can change how point consolidation is made using the consolidateBy graphite function</li>
  204. <li>Point consolidation will effect series legend values (min,max,total,current)</li>
  205. <li>If you override maxDataPoint and set a high value performance can be severely effected</li>
  206. </ul>
  207. </div>
  208. </div>
  209. </div>