Skip to content

Commit cc82a38

Browse files
authored
Merge pull request #179 from vgropp/patch-1
fixes #178 doc for raw_expressions
2 parents 93a7760 + 656f219 commit cc82a38

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Readme.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ During the evaluation, the following variables are available to the expression:
375375
* `last_result` - the result from the previous expression evaluation (a float for `raw_expression`/`expression`, a string for `dynamic_labels`)
376376
* `elapsed` - the time that passed since the previous evaluation, as a [Duration](https://pkg.go.dev/time#Duration) value
377377

378-
The [language definition](https://expr-lang.org/docs/v1.9/Language-Definition) describes the expression syntax. In addition, the following functions are available:
378+
The [language definition](https://expr-lang.org/docs/language-definition) describes the expression syntax. In addition, the following functions are available:
379379
* `now()` - the current time as a [Time](https://pkg.go.dev/time#Time) value
380380
* `int(x)` - convert `x` to an integer value
381381
* `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
400400
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.
401401
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.
402402

403+
#### Expressions in docker environment
404+
405+
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
406+
```
407+
tmpfs:
408+
- /var/lib/mqtt2prometheus:uid=65532,gid=65532,mode=0700
409+
```
410+
403411
## Frequently Asked Questions
404412
405413
### Listen to multiple Topic Pathes

0 commit comments

Comments
 (0)