summaryrefslogtreecommitdiff
path: root/src/catbus-logging.thrust
diff options
context:
space:
mode:
authorEthel Morgan <eth@ethulhu.co.uk>2020-07-06 18:23:10 +0100
committerEthel Morgan <eth@ethulhu.co.uk>2020-07-06 18:23:10 +0100
commitb1e6491f77421ae4623391a7f53af7f3e6c13f34 (patch)
treeacc4ce7ae214b92dbf2c269c70e94b68dac1d640 /src/catbus-logging.thrust
parent04be5845dbaa6f8dec45a80dbe199861608b96f2 (diff)
import website from previous repo
Diffstat (limited to '')
-rw-r--r--src/catbus-logging.thrust46
1 files changed, 46 insertions, 0 deletions
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 %}
+ <nav>
+ <a href='/catbus'>&gt; catbus home</a>
+ </nav>
+ <header>
+ <h1>{{ title }}</h1>
+ <p>{{ subtitle }}</p>
+ </header>
+ <article>
+{% 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 %}
+ </article>
+{% endblock %}