mirror of
https://github.com/timberjoegithub/grafana-statusmap.git
synced 2026-07-21 23:42:03 +00:00
small fixes for README text
This commit is contained in:
@@ -45,7 +45,7 @@ above. These objects should have _discrete statuses_ which are sets of predefine
|
|||||||
### Prometheus
|
### Prometheus
|
||||||
|
|
||||||
To work with data from Prometheus you will need to setup discrete statuses of your objects.
|
To work with data from Prometheus you will need to setup discrete statuses of your objects.
|
||||||
Here are requirements to store these statuses in metrics:
|
Requirements to store these statuses in metrics are as follows:
|
||||||
* metrics should have two values: `0` and `1`;
|
* metrics should have two values: `0` and `1`;
|
||||||
* there should be a label with status' value.
|
* there should be a label with status' value.
|
||||||
|
|
||||||
@@ -55,49 +55,48 @@ When it's done, you can collect all the data via query, e.g.:
|
|||||||
(max_over_time(coffee_maker_status{status="<STATUS_VALUE>"}[$__interval]) == 1) * <STATUS_VALUE>
|
(max_over_time(coffee_maker_status{status="<STATUS_VALUE>"}[$__interval]) == 1) * <STATUS_VALUE>
|
||||||
```
|
```
|
||||||
|
|
||||||
If there was no such status (`<STATUS_VALUE>`) during query's interval, Prometheus will
|
If there was no such status (`<STATUS_VALUE>`) during query's interval, Prometheus would
|
||||||
return nothing. Otherwise, status' value will be returned.
|
return nothing. Otherwise, status' value will be returned.
|
||||||
|
|
||||||
For example, if you have 5 statuses and metric has possible values (0,1,2,3,4) then it
|
For example, if you have 5 statuses and a metric (`coffee_maker_status`) with 5 allowed
|
||||||
should be transformed into previous form with this rule:
|
values (`0`, `1`, `2`, `3`, `4`), you should transform this metric using the following rule:
|
||||||
|
|
||||||
```
|
```
|
||||||
- record: coffee_maker_status:discrete
|
- record: coffee_maker_status:discrete
|
||||||
expr: |
|
expr: |
|
||||||
count_values("status", coffee_maker_status)
|
count_values("status", coffee_maker_status)
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
This rule will transform `coffee_maker_status` metric with value `3` into new metric:
|
That's how `coffee_maker_status` metric with value `3` will be transformed into new metric:
|
||||||
|
|
||||||
```
|
```
|
||||||
coffee_maker_status:discrete{status="3"} 1
|
coffee_maker_status:discrete{status="3"} 1
|
||||||
```
|
```
|
||||||
|
|
||||||
Now, Prometheus has `0` and `1` values for each status as required. These metrics can be aggregated,
|
Now, when Prometheus has `0` and `1` values for each status, all these metrics can be
|
||||||
so you will get all available statuses over time.
|
aggregated, so you will get all available statuses of your objects over time.
|
||||||
|
|
||||||
### Panel
|
### Panel
|
||||||
|
|
||||||
First of all, each possible status value corresponds to a separate query. Each query should have
|
First of all, an individual query for each possible status' value should be created.
|
||||||
similar legend for grouping:
|
Each query should also have similar legend for grouping:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Then, color mapping for status values should be defined in __Discrete__ color mode:
|
Then, color mapping for status' values should be defined in __Discrete__ color mode:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Note: __Spectrum__ and __Opacity__ color modes function the same way they do in [Heatmap](https://grafana.com/plugins/heatmap) plugin.
|
_Note: __Spectrum__ and __Opacity__ color modes function the same way they do in [Heatmap](https://grafana.com/plugins/heatmap) plugin._
|
||||||
|
|
||||||
|
|
||||||
### More options
|
### More options
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
__Multiple values__ checkbox determine multiple values display mode:
|
__Multiple values__ checkbox specifies how they should be displayed:
|
||||||
* If it's off, multiple values for one bucket are treated as error;
|
* If it's off, multiple values for one bucket are treated as error;
|
||||||
* If it's on, color for bucket would be determined by the value having least index in color mapping.
|
* If it's on, color for such bucket would be determined by the value having least index in color mapping.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -114,7 +113,7 @@ __Rounding__ may be used to round edges.
|
|||||||
## Development
|
## Development
|
||||||
|
|
||||||
To test and improve the plugin you can run Grafana instance in Docker using following command (in
|
To test and improve the plugin you can run Grafana instance in Docker using following command (in
|
||||||
the directory containing the plugin):
|
the directory containing Statusmap plugin):
|
||||||
|
|
||||||
```
|
```
|
||||||
docker run --rm -it -v $PWD:/var/lib/grafana/plugins/flant-statusmap-panel \
|
docker run --rm -it -v $PWD:/var/lib/grafana/plugins/flant-statusmap-panel \
|
||||||
@@ -132,9 +131,9 @@ grunt watch
|
|||||||
|
|
||||||
## Acknowledgements
|
## Acknowledgements
|
||||||
|
|
||||||
The first public release of this plugin has been fully prepared by [Flant](https://flant.com/) engineers. Idea comes from Dmitry Stolyarov ([@distol](https://github.com/distol)), initial version is written by Sergey Gnuskov ([@gsmetal](https://github.com/gsmetal)) and final changes are made by Ivan Mikheykin ([@diafour](https://github.com/diafour)).
|
The first public release of this plugin has been fully made by [Flant](https://flant.com/) engineers. The whole idea has come from Dmitry Stolyarov ([@distol](https://github.com/distol)), initial version has been written by Sergey Gnuskov ([@gsmetal](https://github.com/gsmetal)) and final changes has been made by Ivan Mikheykin ([@diafour](https://github.com/diafour)).
|
||||||
|
|
||||||
This plugin is based on "Heatmap" panel by Grafana and inspired by ideas from Carpet plot, Discrete panel, Status Panel, Status Dot, Status By Group.
|
This plugin is based on "Heatmap" panel by Grafana and partly inspired by ideas from Carpet plot, Discrete panel, Status Panel, Status Dot, Status By Group.
|
||||||
|
|
||||||
#### Changelog
|
#### Changelog
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user