grafana/docs/sources/reference/singlestat.md

88 lines
6.4 KiB
Markdown
Raw Normal View History

Squashed commit of the following: commit 4113ed00782590187d19dd2f8cbae683f164142c Author: Torkel Ödegaard <torkel.odegaard@gmail.com> Date: Fri Oct 21 10:47:35 2016 +0200 docs(): minor fix for docs index page commit 45478d120571519462fac905aadeab5954696690 Author: Torkel Ödegaard <torkel.odegaard@gmail.com> Date: Thu Oct 20 14:28:21 2016 +0200 updated commit c9c1c1d5a462f85e8001a45218f24102583d7aee Author: Torkel Ödegaard <torkel.odegaard@gmail.com> Date: Thu Oct 20 14:27:34 2016 +0200 docs(): updated image refs commit 5fa0f27963968d77bbbbb7edd973847ea72135e3 Author: Torkel Ödegaard <torkel.odegaard@gmail.com> Date: Wed Oct 19 14:33:04 2016 +0200 docs is almost done commit 6b988c90cb08563e2c27212338c2947e69f6fcc3 Author: Torkel Ödegaard <torkel.odegaard@gmail.com> Date: Tue Oct 18 20:45:28 2016 +0200 almost done commit 17757c21ed813892ddb1f289f2e52613caf7bcef Author: Torkel Ödegaard <torkel@grafana.org> Date: Tue Oct 18 16:45:48 2016 +0200 making progress on docs commit f06c815991dd81b8893912a6da04a17b80b63fda Author: Torkel Ödegaard <torkel.odegaard@gmail.com> Date: Tue Oct 18 14:30:55 2016 +0200 progress on new docs commit 5197237426252623de2d8b9cc22ddbbdbb240763 Author: Torkel Ödegaard <torkel.odegaard@gmail.com> Date: Tue Oct 18 13:25:26 2016 +0200 making progress commit 33e2b6b617f16f65878141cf11e54b2817a2ea96 Merge: de385e5 ecb4a99 Author: Torkel Ödegaard <torkel.odegaard@gmail.com> Date: Tue Oct 18 12:17:58 2016 +0200 Merge branch 'new-docs' of github.com:grafana/grafana into new-docs commit ecb4a99dd54aa39f17d9bf4d7e132a389812f8fd Author: Torkel Ödegaard <torkel@grafana.org> Date: Tue Oct 18 10:39:59 2016 +0200 keep urls for now commit de385e56d86b071cf2150ccf9f1aa06ec5187277 Author: Torkel Ödegaard <torkel.odegaard@gmail.com> Date: Mon Oct 17 17:56:18 2016 +0200 more progress commit 8469ebc239ab2316cbbc01862e5026737f272f00 Author: Torkel Ödegaard <torkel.odegaard@gmail.com> Date: Mon Oct 17 17:08:06 2016 +0200 progress on new docs commit e755f656b12534cfcb23bad11f1fa696e43f7428 Merge: 4644a35 35cce3b Author: Torkel Ödegaard <torkel.odegaard@gmail.com> Date: Mon Oct 17 12:21:27 2016 +0200 Merge branch 'new-docs' of github.com:grafana/grafana into new-docs commit 4644a35102555204787e91041b50dcbfe0f7a213 Merge: 25c4bef 977cdd5 Author: Torkel Ödegaard <torkel.odegaard@gmail.com> Date: Mon Oct 17 12:21:11 2016 +0200 Merge branch 'master' of github.com:grafana/grafana into new-docs commit 35cce3bef802fac020a53693b02c112a91a096fc Author: Torkel Ödegaard <torkel@grafana.org> Date: Mon Oct 17 09:31:17 2016 +0200 progress on #6170 commit 25c4bef629de7d77218ba95cc3bd25fb50bb19d6 Author: Torkel Ödegaard <torkel.odegaard@gmail.com> Date: Sun Oct 16 15:05:30 2016 +0200 fix for osx commit 6c6b52f975630be87da23dd51beafaecb820cec2 Author: Torkel Ödegaard <torkel@grafana.org> Date: Sun Oct 16 12:56:39 2016 +0200 progress on new docs commit 6a09633981ab26191d5542dbe3a788846ac6b73d Author: Torkel Ödegaard <torkel@grafana.org> Date: Sat Oct 15 11:39:49 2016 +0200 progress on new docs commit 7d533fbc23e41b86fd1ba9c955dd17ae1ad977e5 Author: Torkel Ödegaard <torkel@grafana.org> Date: Mon Oct 10 09:25:12 2016 +0200 making progress on new docs site commit 50392ce98edfa201977716e92e4a86f9d48ae386 Author: Torkel Ödegaard <torkel@grafana.org> Date: Sun Oct 9 20:02:28 2016 +0200 feat(new docs): progress on new docs site commit 81a3d3d0952d3a5d790412e90d01ac5a247e0686 Author: Torkel Ödegaard <torkel@grafana.org> Date: Fri Oct 7 07:52:11 2016 +0200 new docs site experiment commit 704adc98664665b3624087ab38ce29fc9da005f1 Author: Torkel Ödegaard <torkel@grafana.org> Date: Sat Oct 1 20:46:53 2016 +0200 new docs poc
2016-10-21 04:01:34 -05:00
+++
title = "Singletat Panel"
keywords = ["grafana", "dashboard", "documentation", "panels", "singlestat"]
type = "docs"
[menu.docs]
name = "Singlestat"
parent = "panels"
weight = 2
+++
2015-03-13 04:20:39 -05:00
# Singlestat Panel
2016-11-04 14:29:17 -05:00
![](/img/docs/v1/singlestat_panel2.png)
2015-03-13 04:20:39 -05:00
2015-08-11 12:49:24 -05:00
The Singlestat Panel allows you to show the one main summary stat of a SINGLE series. It reduces the series into a single number (by looking at the max, min, average, or sum of values in the series). Singlestat also provides thresholds to color the stat or the Panel background. It can also translate the single number into a text value, and show a sparkline summary of the series.
2015-03-27 08:23:23 -05:00
2015-07-15 16:27:55 -05:00
### Singlestat Panel Configuration
2015-07-15 16:27:55 -05:00
The singlestat panel has a normal query editor to allow you define your exact metric queries like many other Panels. Through the Options tab, you can access the Singlestat-specific functionality.
2016-11-04 14:29:17 -05:00
<img class="no-shadow" src="/img/docs/v1/Singlestat-BaseSettings.png">
2015-07-15 16:27:55 -05:00
1. `Big Value`: Big Value refers to how we display the main stat for the Singlestat Panel. This is always a single value that is displayed in the Panel in between two strings, `Prefix` and `Suffix`. The single number is calculated by choosing a function (min,max,average,current,total) of your metric query. This functions reduces your query into a single numeric value.
2015-10-23 09:29:15 -05:00
2. `Font Size`: You can use this section to select the font size of the different texts in the Singlestat Panel, i.e. prefix, value and postfix.
3. `Values`: The Value fields let you set the function (min, max, average, current, total, first, delta, range) that your entire query is reduced into a single value with. You can also set the font size of the Value field and font-size (as a %) of the metric query that the Panel is configured with. This reduces the entire query into a single summary value that is displayed.
* `min` - The smallest value in the series
* `max` - The largest value in the series
* `average` - The average of all the non-null values in the series
* `current` - The last value in the series. If the series ends on null the previous value will be used.
* `total` - The sum of all the non-null values in the series
* `first` - The first value in the series
2016-11-29 00:32:51 -06:00
* `delta` - The total incremental increase (of a counter) in the series. An attempt is made to account for counter resets, but this will only be accurate for single instance metrics. Used to show total counter increase in time series.
* `range` - The difference between 'min' and 'max'. Useful the show the range of change for a gauge.
2015-07-15 16:27:55 -05:00
4. `Postfixes`: The Postfix fields let you define a custom label and font-size (as a %) to appear *after* the value
5. `Units`: Units are appended to the the Singlestat within the panel, and will respect the color and threshold settings for the value.
2015-10-22 00:09:07 -05:00
6. `Decimals`: The Decimal field allows you to override the automatic decimal precision, and set it explicitly.
### Coloring
2015-07-15 16:27:55 -05:00
The coloring options of the Singlestat Panel config allow you to dynamically change the colors based on the Singlestat value.
2016-11-04 14:29:17 -05:00
<img class="no-shadow" src="/img/docs/v1/Singlestat-Coloring.png">
2015-10-22 00:09:07 -05:00
1. `Background`: This checkbox applies the configured thresholds and colors to the entirety of the Singlestat Panel background.
2015-07-15 16:27:55 -05:00
2. `Value`: This checkbox applies the configured thresholds and colors to the summary stat.
3. `Thresholds`: Change the background and value colors dynamically within the panel, depending on the Singlestat value. The threshold field accepts **2 comma-separated** values which represent 3 ranges that correspond to the three colors directly to the right. For example: if the thresholds are 70, 90 then the first color represents < 70, the second color represents between 70 and 90 and the third color represents > 90.
2015-07-15 16:27:55 -05:00
4. `Colors`: Select a color and opacity
2016-11-04 14:29:17 -05:00
5. `Invert order`: This link toggles the threshold color order.</br>For example: Green, Orange, Red (<img class="no-shadow" src="/img/docs(v1/gyr.png">) will become Red, Orange, Green (<img class="no-shadow" src="/img/docs/v1/ryg.png">).
### Spark Lines
2015-08-11 12:49:24 -05:00
Sparklines are a great way of seeing the historical data related to the summary stat, providing valuable context at a glance. Sparklines act differently than traditional Graph Panels and do not include x or y axis, coordinates, a legend, or ability to interact with the graph.
2016-11-04 14:29:17 -05:00
<img class="no-shadow" src="/img/docs/v1/Singlestat-Sparklines.png">
2015-07-15 16:27:55 -05:00
1. `Show`: The show checkbox will toggle whether the spark line is shown in the Panel. When unselected, only the Singlestat value will appear.
2. `Background`: Check if you want the sparklines to take up the full panel width, or uncheck if they should be below the main Singlestat value.
3. `Line Color`: This color selection applies to the color of the sparkline itself.
2015-07-10 08:34:54 -05:00
4. `Fill Color`: This color selection applies to the area below the sparkline.
2015-07-10 08:34:54 -05:00
> ***Pro-tip:*** Reduce the opacity on fill colors for nice looking panels.
### Value to text mapping
2015-07-15 16:27:55 -05:00
Value to text mapping allows you to translate the value of the summary stat into explicit text. The text will respect all styling, thresholds and customization defined for the value. This can be useful to translate the number of the main Singlestat value into a context-specific human-readable word or message.
2016-11-04 14:29:17 -05:00
<img class="no-shadow" src="/img/docs/v1/Singlestat-ValueMapping.png">
## Troubleshooting
### Multiple Series Error
2016-11-04 14:29:17 -05:00
<img class="no-shadow" src="/img/docs/v2/Singlestat-MultiSeriesError.png">
Grafana 2.5 introduced stricter checking for multiple-series on singlestat panels. In previous versions, the panel logic did not verify that only a single series was used, and instead, displayed the first series encountered. Depending on your data source, this could have lead to inconsistent data being shown and/or a general confusion about which metric was being displayed.
To fix your singlestat panel:
- Edit your panel by clicking the Panel Title and selecting *Edit*.
- Do you have multiple queries in the metrics tab?
2015-11-12 11:35:45 -06:00
- Solution: Select a single query to visualize. You can toggle whether a query is visualized by clicking the eye icon on each line. If the error persists, continue to the next solution.
- Do you have one query?
- Solution: This likely means your query is returning multiple series. You will want to reduce this down to a single series. This can be accomplished in many ways, depending on your data source. Some common practices include summing the series, averaging or any number of other functions. Consult the documentation for your data source for additional information.