From 656f219bc63939c708af971f839f16916c91fc83 Mon Sep 17 00:00:00 2001 From: Volker Gropp Date: Sat, 15 Nov 2025 10:38:13 +0100 Subject: [PATCH] fixes #178 doc for raw_expressions fixes docker documentation for raw_expressions use --- Readme.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index 29b25f9..5fd0e3b 100644 --- a/Readme.md +++ b/Readme.md @@ -375,7 +375,7 @@ During the evaluation, the following variables are available to the expression: * `last_result` - the result from the previous expression evaluation (a float for `raw_expression`/`expression`, a string for `dynamic_labels`) * `elapsed` - the time that passed since the previous evaluation, as a [Duration](https://pkg.go.dev/time#Duration) value -The [language definition](https://expr-lang.org/docs/v1.9/Language-Definition) describes the expression syntax. In addition, the following functions are available: +The [language definition](https://expr-lang.org/docs/language-definition) describes the expression syntax. In addition, the following functions are available: * `now()` - the current time as a [Time](https://pkg.go.dev/time#Time) value * `int(x)` - convert `x` to an integer value * `float(x)` - convert `x` to a floating point value @@ -400,6 +400,14 @@ If `raw_expression` is set, the generated value of the expression is exported to 1. If `force_monotonicy` is set to `true`, any new value that is smaller than the previous one is considered to be a counter reset. When a reset is detected, the previous value becomes the value offset which is automatically added to each consecutive value. The offset is persistet between restarts of mqtt2prometheus. 1. If `mqtt_value_scale` is set to a non-zero value, it is applied to the the value to yield the final metric value. +#### Expressions in docker environment + +With expressions enabled the exporter will persist the conversion into /var/lib/mqtt2prometheus. This directory needs to be writable for the user. One solution is to use `--tmpfs /var/lib/mqtt2prometheus:uid=65532,gid=65532,mode=700` in your docker command or to add to docker-compose.yml +``` +tmpfs: + - /var/lib/mqtt2prometheus:uid=65532,gid=65532,mode=0700 +``` + ## Frequently Asked Questions ### Listen to multiple Topic Pathes