From 6ca476fe215d87696a616c83b7b49f48e04d1f5a Mon Sep 17 00:00:00 2001 From: Anton Tolchanov <1687799+knyar@users.noreply.github.com> Date: Sun, 5 Jul 2020 18:00:37 +0100 Subject: [PATCH] Add prometheus metric naming guidelines (#37149) * Add prometheus metric naming guidelines. * Update homeassistant/components/prometheus/README.md Co-authored-by: Martin Weinelt <mweinelt@users.noreply.github.com> Co-authored-by: Martin Weinelt <mweinelt@users.noreply.github.com> --- homeassistant/components/prometheus/README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 homeassistant/components/prometheus/README.md diff --git a/homeassistant/components/prometheus/README.md b/homeassistant/components/prometheus/README.md new file mode 100644 index 00000000000..64a6bdc4885 --- /dev/null +++ b/homeassistant/components/prometheus/README.md @@ -0,0 +1,15 @@ +# Prometheus integration + +This integration exposes metrics in a Prometheus compatible format. + +## Metric naming guidelines + +Please follow these guidelines while defining metrics. + +* Metric and label names should conform to [Prometheus + naming guidelines](https://prometheus.io/docs/practices/naming/). +* Domain-specific metrics should have the domain (`sensor`, `switch`, + `climate`, etc.) as a metric name prefix. +* Enum-like values (e.g. entity state or current mode) should be exported using + a "boolean" metric (values of 0 or 1) broken down by state/mode (as a metric + label). -- GitLab