Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Threshhods from runtime requests #141

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ You can also repeat the panel on a template if you have multiple instances that

## How to use

1. Add the queries you want to the panel and give each of them a unique alias
1. Add the queries you want to the panel and give each of them a unique alias. If you need threshold queries set alias started with 'Threshold_'
2. Choose the name of the panel to be displayed in the `Panel Title` field.
**Note:** this field supports Grafana templates, so if you repeat the panel the correct name will show
3. Go to the Options tab, and choose how to treat each metric.
1. For severity display, select one of the `Threshold` option types (`Number Threshold` / `String Threshold` / `Date Threshold`) under `Handler Type`. Enter the `Warning` and `Critical` thresholds for each of your queries.
* You can configure when the alias name and its value will be displayed in the dashboard panel by changing the fields: `Display Alias`, `Display Value`
* `String Threshold` option makes equality check to the values
* `Number Threshold` and `Date Threshold` options make range check with the values. The plugin automatically detects if higher values are good, or lower values are good by checking which threshold is higher/lower. i.e. if in your metric higher values are better, put a lower value in the `critical` threshold than the `warning` threshold.
* `Number Threshold`, `Date Threshold` and `Request Threshold` options make range check with the values. The plugin automatically detects if higher values are good, or lower values are good by checking which threshold is higher/lower. i.e. if in your metric higher values are better, put a lower value in the `critical` threshold than the `warning` threshold.
2. For disable display, select the `Disable Criteria` option type under `Handler Type`. Enter the `Disable Value` for each of your queries.
3. For display the text without any condition, select the `Text Only` option type under `Handler Type`. The alias + the value of the metric will be shown on the panel by the `Display Type` value.
4. If the query returns multiple values, choose the type of aggregation you want to be used (`None` will use first item from the result)
Expand Down
151 changes: 90 additions & 61 deletions dist/css/status_panel.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 1 addition & 7 deletions dist/css/status_panel.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 22 additions & 4 deletions dist/editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ <h5 class="section-heading">Metric display type</h5>
required></select>
</div>
</div>
<div ng-if="measurement.valueHandler == 'Number Threshold'">
<div ng-if="measurement.valueHandler == 'Number Threshold' || measurement.valueHandler == 'Request Threshold' ">
<!--Units-->
<div class="gf-form">
<span class="gf-form-label width-12">
Expand Down Expand Up @@ -294,7 +294,7 @@ <h5 class="section-heading">Metric display type</h5>

<div class="section gf-form-group">
<!--Threshold Section-->
<div ng-if="measurement.valueHandler == 'Number Threshold' || measurement.valueHandler == 'String Threshold' || measurement.valueHandler == 'Date Threshold'">
<div ng-if="measurement.valueHandler == 'Number Threshold' || measurement.valueHandler == 'String Threshold' || measurement.valueHandler == 'Date Threshold' || measurement.valueHandler == 'Request Threshold'">
<h5 class="section-heading">Threshold
<info-popover mode="normal">
The Warning and Critical fields get numbers, strings or dates. <br/>
Expand All @@ -313,7 +313,16 @@ <h5 class="section-heading">Threshold
<input type="text" ng-if="measurement.valueHandler == 'String Threshold'"
name="warn" ng-model="measurement.warn" class="gf-form-input max-width-14" ng-change="ctrl.onRender()" required />
<input type="datetime-local" ng-if="measurement.valueHandler == 'Date Threshold'"
name="warn" ng-model="measurement.warn" class="gf-form-input max-width-14" ng-change="ctrl.onRender()" required />
name="warn" ng-model="measurement.warn" class="gf-form-input max-width-14" ng-change="ctrl.onRender()" required />
<select class="gf-form-input"
ng-if="measurement.valueHandler == 'Request Threshold'"
ng-init="measurement.warn = (measurement.warn ? measurement.warn : 'Disabled')"
ng-model="measurement.warn"
ng-change="ctrl.onRender()"
required>
<option value="Disabled">Disabled</option>
<option ng-repeat="item in ctrl.threshold_series" value="{{item.target}}">{{item.target}}</option>
</select>
</div>

<!--Critical threshold-->
Expand All @@ -326,7 +335,16 @@ <h5 class="section-heading">Threshold
<input type="text" ng-if="measurement.valueHandler == 'String Threshold'"
name="crit" ng-model="measurement.crit" class="gf-form-input max-width-14" ng-change="ctrl.onRender()" required />
<input type="datetime-local" ng-if="measurement.valueHandler == 'Date Threshold'"
name="crit" ng-model="measurement.crit" class="gf-form-input max-width-14" ng-change="ctrl.onRender()" required />
name="crit" ng-model="measurement.crit" class="gf-form-input max-width-14" ng-change="ctrl.onRender()" required />
<select class="gf-form-input"
ng-if="measurement.valueHandler == 'Request Threshold'"
ng-init="measurement.crit = (measurement.crit ? measurement.crit : 'Disabled')"
ng-model="measurement.crit"
ng-change="ctrl.onRender()"
required>
<option value="Disabled">Disabled</option>
<option ng-repeat="item in ctrl.threshold_series" value="{{item.target}}">{{item.target}}</option>
</select>
</div>

<!--Display Value Type-->
Expand Down
44 changes: 37 additions & 7 deletions dist/status_ctrl.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/status_ctrl.js.map

Large diffs are not rendered by default.

Loading