diff options
Diffstat (limited to 'src/catbus-logging.thrust')
-rw-r--r-- | src/catbus-logging.thrust | 46 |
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'>> 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 %} |