editor.html 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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="GraphiteTargetCtrl"
  6. ng-init="init()">
  7. <div class="grafana-target-inner">
  8. <ul class="grafana-target-controls">
  9. <li ng-show="parserError">
  10. <a bs-tooltip="parserError" style="color: rgb(229, 189, 28)" role="menuitem">
  11. <i class="icon icon-warning-sign"></i>
  12. </a>
  13. </li>
  14. <li>
  15. <a class="pointer" tabindex="1" ng-click="showTextEditor = !showTextEditor">
  16. <i class="icon icon-pencil"></i>
  17. </a>
  18. </li>
  19. <li class="dropdown">
  20. <a class="pointer dropdown-toggle"
  21. data-toggle="dropdown"
  22. tabindex="1">
  23. <i class="icon icon-cog"></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. </ul>
  32. </li>
  33. <li>
  34. <a class="pointer" tabindex="1" ng-click="removeDataQuery(target)">
  35. <i class="icon icon-remove"></i>
  36. </a>
  37. </li>
  38. </ul>
  39. <ul class="grafana-segment-list">
  40. <li class="grafana-target-segment" style="min-width: 15px; text-align: center">
  41. {{targetLetters[$index]}}
  42. </li>
  43. <li>
  44. <a class="grafana-target-segment"
  45. ng-click="target.hide = !target.hide; get_data();"
  46. role="menuitem">
  47. <i class="icon-eye-open"></i>
  48. </a>
  49. </li>
  50. </ul>
  51. <input type="text"
  52. class="grafana-target-text-input span10"
  53. ng-model="target.target"
  54. focus-me="showTextEditor"
  55. spellcheck='false'
  56. ng-model-onblur ng-change="targetTextChanged()"
  57. ng-show="showTextEditor" />
  58. <ul class="grafana-segment-list" role="menu" ng-hide="showTextEditor">
  59. <li ng-repeat="segment in segments" role="menuitem" graphite-segment></li>
  60. <li ng-repeat="func in functions">
  61. <span graphite-func-editor class="grafana-target-segment grafana-target-function">
  62. </span>
  63. </li>
  64. <li class="dropdown" graphite-add-func>
  65. </li>
  66. </ul>
  67. <div class="clearfix"></div>
  68. </div>
  69. </div>
  70. </div>
  71. <section class="grafana-metric-options">
  72. <div class="grafana-target-inner">
  73. <ul class="grafana-segment-list">
  74. <li class="grafana-target-segment grafana-target-segment-icon">
  75. <i class="icon-wrench"></i>
  76. </li>
  77. <li class="grafana-target-segment">
  78. cacheTimeout
  79. </li>
  80. <li>
  81. <input type="text"
  82. class="input-mini grafana-target-segment-input"
  83. ng-model="panel.cacheTimeout"
  84. bs-tooltip="'Graphite parameter to overwride memcache default timeout (unit is seconds)'"
  85. data-placement="right"
  86. spellcheck='false'
  87. placeholder="60">
  88. </li>
  89. </ul>
  90. <div class="clearfix"></div>
  91. </div>
  92. <div class="grafana-target-inner">
  93. <ul class="grafana-segment-list">
  94. <li class="grafana-target-segment grafana-target-segment-icon">
  95. <i class="icon-info-sign"></i>
  96. </li>
  97. <li class="grafana-target-segment">
  98. <a ng-click="toggleEditorHelp(1);" bs-tooltip="'click to show helpful info'" data-placement="bottom">
  99. shorter legend names
  100. </a>
  101. </li>
  102. <li class="grafana-target-segment">
  103. <a ng-click="toggleEditorHelp(2);" bs-tooltip="'click to show helpful info'" data-placement="bottom">
  104. series as parameters
  105. </a>
  106. </li>
  107. <li class="grafana-target-segment">
  108. <a ng-click="toggleEditorHelp(3)" bs-tooltip="'click to show helpful info'" data-placement="bottom">
  109. stacking
  110. </a>
  111. </li>
  112. <li class="grafana-target-segment">
  113. <a ng-click="toggleEditorHelp(4)" bs-tooltip="'click to show helpful info'" data-placement="bottom">
  114. templating
  115. </a>
  116. </li>
  117. </ul>
  118. <div class="clearfix"></div>
  119. </div>
  120. </div>
  121. </section>
  122. <div class="editor-row">
  123. <div class="pull-left" style="margin-top: 30px;">
  124. <div class="grafana-info-box span8" ng-if="editorHelpIndex === 1">
  125. <h5>Shorter legend names</h5>
  126. <ul>
  127. <li>alias() function to specify a custom series name</li>
  128. <li>aliasByNode(2) to alias by a specific part of your metric path</li>
  129. <li>aliasByNode(2, -1) you can add multiple segment paths, and use negative index</li>
  130. <li>groupByNode(2, 'sum') is useful if you have 2 wildcards in your metric path and want to sumSeries and group by</li>
  131. </ul>
  132. </div>
  133. <div class="grafana-info-box span8" ng-if="editorHelpIndex === 2">
  134. <h5>Series as parameter</h5>
  135. <ul>
  136. <li>Some graphite functions allow you to have many series arguments</li>
  137. <li>Use #[A-Z] to use a graphite query as parameter to a function</li>
  138. <li>
  139. Examples:
  140. <ul>
  141. <li>asPercent(#A, #B)</li>
  142. <li>prod.srv-01.counters.count - asPercent(#A) : percentage of count in comparison with A query</li>
  143. <li>prod.srv-01.counters.count - sumSeries(#A) : sum count and series A </li>
  144. <li>divideSeries(#A, #B)</li>
  145. </ul>
  146. </li>
  147. <li>If a query is added only to be used as a parameter, hide it from the graph with the eye icon</li>
  148. </ul>
  149. </div>
  150. <div class="grafana-info-box span6" ng-if="editorHelpIndex === 3">
  151. <h5>Stacking</h5>
  152. <ul>
  153. <li>You find the stacking option under Display Styles tab</li>
  154. <li>When stacking is enabled make sure null point mode is set to 'null as zero'</li>
  155. </ul>
  156. </div>
  157. <div class="grafana-info-box span6" ng-if="editorHelpIndex === 4">
  158. <h5>Templating</h5>
  159. <ul>
  160. <li>You can use a template variable in place of metric names</li>
  161. <li>You can use a template variable in place of function parameters</li>
  162. <li>You enable the templating feature in Dashboard settings / Feature toggles </li>
  163. </ul>
  164. </div>
  165. </div>
  166. </div>