mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-15 13:26:54 +00:00
Add details about unavailable and unknown states for Prometheus (#17039)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
parent
74c5623323
commit
bd4da14485
@ -179,3 +179,16 @@ When looking into the metrics on the Prometheus side, there will be:
|
||||
- The [client library](https://github.com/prometheus/client_python) provided metrics, which are a bunch of **process_\*** and also a single pseudo-metric **python_info** which contains (not as value but as labels) information about the Python version of the client, i.e., the Home Assistant Python interpreter.
|
||||
|
||||
Typically, you will only be interested in the first set of metrics.
|
||||
|
||||
## Metrics in unavailable or unknown states
|
||||
|
||||
When the Prometheus exporter starts (typically when Home Assistant starts), all non-excluded entities in an unavailable or unknown state are not be exported until they are available again. If the entity goes into state unavailable or unknown again, the value exported will always be the latest known one.
|
||||
|
||||
While an entity is in those states, the `entity_available` corresponding metric is set to 0. This metric can be used to filter out values while the entity is unavailable or in an unknown state thanks to a [recording rule](https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/).
|
||||
|
||||
For example:
|
||||
|
||||
```yaml
|
||||
- record: "known_temperature_c"
|
||||
expr: "temperature_c unless entity_available == 0"
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user