From b1e6491f77421ae4623391a7f53af7f3e6c13f34 Mon Sep 17 00:00:00 2001 From: Ethel Morgan Date: Mon, 6 Jul 2020 18:23:10 +0100 Subject: import website from previous repo --- src/catbus-logging.thrust | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 src/catbus-logging.thrust (limited to 'src/catbus-logging.thrust') diff --git a/src/catbus-logging.thrust b/src/catbus-logging.thrust new file mode 100644 index 0000000..bd41472 --- /dev/null +++ b/src/catbus-logging.thrust @@ -0,0 +1,46 @@ +--- +title: 'CatBus: logging' +subtitle: easy low-configuration logging +date: 2020-02-20 +--- +{% extends 'templates/base.html' %} +{% block body %} + +
+

{{ title }}

+

{{ subtitle }}

+
+
+{% markdown %} +Using the MQTT bus as a unified system with a unified semantic naming scheme means that I can also implement logging without the need for much configuration. + +Following the above scheme, we can automatically scrape all devices named `*-sensor` into Prometheus metrics: + +``` +$control{zone=$zone,device=$device} = $value +``` + +For example, + +``` +temperature_celsius{zone=bedroom,device=window-sensor} = 17 +``` + +Likewise, we can export enums as: + +``` +home/zone/device/control_enum: + foo + +home/zone/device/control_enum/values: + bar + foo + +control{zone=,device=,value=bar} = 0 +control{zone=,device=,value=foo} = 1 +``` +{% endmarkdown %} +
+{% endblock %} -- cgit v1.2.3