Commit Graph

294 Commits

Author SHA1 Message Date
Renovate Bot
d8aa919ce3 Update module github.com/eclipse/paho.mqtt.golang to v1.5.1 2025-11-16 14:33:27 +00:00
Christoph Petrausch
befccd7050 Merge pull request #176 from WGH-/fix-systemd-unit-path
Install systemd unit to /usr/lib
2025-11-16 11:51:55 +01:00
Christoph Petrausch
cc82a38b21 Merge pull request #179 from vgropp/patch-1
fixes #178 doc for raw_expressions
2025-11-16 11:51:40 +01:00
Christoph Petrausch
93a77607f6 Merge pull request #173 from Himura2la/master
Add Qingping Air Monitor Lite example
2025-11-16 08:56:46 +01:00
Volker Gropp
656f219bc6 fixes #178 doc for raw_expressions
fixes docker documentation for raw_expressions use
2025-11-15 10:38:13 +01:00
WGH
83e697966d Install systemd unit to /usr/lib
Package provided systemd units go in /usr/lib/, not in /etc. See man
systemd.unit, section "UNIT FILE LOAD PATH".
2025-09-09 01:55:51 +03:00
Himura Kazuto
b10f083f44 Add Qingping Air Monitor Lite example 2025-06-02 14:42:47 +04:00
Christoph Petrausch
8bd029b13c Merge pull request #163 from fatpat/dynamic-labels
add dynamic labels
2025-01-21 10:08:24 +01:00
Jérôme LOYET
ce77333416 add dynamic labels 2025-01-17 05:56:27 +01:00
Christoph Petrausch
ce8ad0739b Merge pull request #162 from fatpat/raw_expression
add raw_expression
2025-01-07 22:15:58 +01:00
Jérôme LOYET
5ede83bcb7 add raw_expression 2025-01-01 09:01:41 +01:00
Christoph Petrausch
6bd07d1e22 Merge pull request #161 from fatpat/expr_int/float
improve expr float() and int() to handle strings
2024-12-31 22:23:54 +01:00
Christoph Petrausch
3a9ad76b8f Merge pull request #157 from fatpat/error_value
make error_value global to metric and add error_expression
2024-12-31 22:21:19 +01:00
Jérôme LOYET
e18dc0b9ce improve expr float() and int() to handle strings 2024-12-30 09:54:28 +01:00
Jérôme LOYET
d28d6cd818 make error_value global to metric
* fail if both metric.error_value and
  metric.string_value_mapping.error_value are set
* mark metric.string_value_mapping.error_value as deprecated
2024-12-30 09:53:12 +01:00
Christoph Petrausch
4674e6a17f Merge pull request #160 from hikhvar/dependabot/go_modules/golang.org/x/crypto-0.31.0
Bump golang.org/x/crypto from 0.0.0-20210616213533-5ff15b29337e to 0.31.0
2024-12-27 20:19:06 +01:00
Christoph Petrausch
3737608799 Merge pull request #150 from hikhvar/renovate/prom-prometheus-2.x
Update dependency prom/prometheus to v2.52.0
2024-12-27 20:09:58 +01:00
Christoph Petrausch
fe7ac1c9d6 Merge pull request #153 from hikhvar/renovate/golang-1.x
Update dependency golang to v1.23
2024-12-27 20:09:31 +01:00
Christoph Petrausch
defc591c1e Merge pull request #158 from hikhvar/dependabot/go_modules/google.golang.org/protobuf-1.33.0
Bump google.golang.org/protobuf from 1.26.0-rc.1 to 1.33.0
2024-12-27 20:09:19 +01:00
dependabot[bot]
b9c15e86b6 Bump golang.org/x/crypto
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.0.0-20210616213533-5ff15b29337e to 0.31.0.
- [Commits](https://github.com/golang/crypto/commits/v0.31.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-27 19:05:54 +00:00
dependabot[bot]
e04788d0ef Bump google.golang.org/protobuf from 1.26.0-rc.1 to 1.33.0
Bumps google.golang.org/protobuf from 1.26.0-rc.1 to 1.33.0.

---
updated-dependencies:
- dependency-name: google.golang.org/protobuf
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-27 19:05:53 +00:00
Christoph Petrausch
4b0085b8cc Merge pull request #156 from fatpat/update-expr
update expr to 1.16.9
2024-12-27 20:05:03 +01:00
Jérôme LOYET
6ff26135b2 update expr to 1.16.9
- update minimal go version from 1.16 to 1.18 (like expr)
- update test from go 1.16 to 1.23
2024-12-27 08:39:41 +01:00
Renovate Bot
7a8e831a6d chore(deps): update dependency prom/prometheus to v2.55.1 2024-12-26 14:33:11 +00:00
Renovate Bot
d729a8b608 chore(deps): update dependency golang to v1.23 2024-12-26 14:33:09 +00:00
Christoph Petrausch
9309470930 Merge pull request #154 from alfrunes/config-profiling-metrics
feat: Add configuration option to enable/disable profiling metrics
2024-12-26 13:04:31 +01:00
Alf-Rune Siqveland
95bbd81f7d feat: Add configuration option to enable/disable profiling metrics
Added a new configuration `enable_profiling_metrics` which
enable/disable the default runtime metrics exported by the Prometheus
client package.

BREAKING CHANGE: Changed default behavior to exclude runtime metrics.
        Enable with enable_profiling_metrics configuration option.
Signed-off-by: Alf-Rune Siqveland <alf.rune@siqveland.no>
2024-08-18 12:44:23 +02:00
Christoph Petrausch
0137ffc738 Merge pull request #143 from chrschn/expressions
Expressions
2024-05-19 20:18:38 +02:00
Christoph Petrausch
e1033ddf06 Merge pull request #145 from pdostal/shelly_ht
Add example for Shelly H&T sensor
2024-03-25 10:28:29 +01:00
Christoph Petrausch
e748c6f823 Merge pull request #147 from podorozhny/patch-1
fix typo
2024-03-25 10:28:16 +01:00
Christoph Petrausch
8a185ed151 Merge pull request #146 from hikhvar/renovate/golang-1.x
Update dependency golang to v1.22
2024-03-25 10:28:03 +01:00
Christoph Petrausch
5b7d22bea8 Merge pull request #144 from hikhvar/renovate/prom-prometheus-2.x
Update dependency prom/prometheus to v2.49.0
2024-03-25 10:27:51 +01:00
Christian Schneider
cd459836a6 Improved error reporting. 2024-03-25 10:15:05 +01:00
Christian Schneider
9f92116fe3 Support multiple configs per input metric.
When generating metric values using expression evaluation, there are new
use-cases for more than one configuration for each sensor value.
Expressions are more flexible than aggregation rules in Prometheus, so
it makes sense to derive multiple metrics from the same sensor input.
2024-03-25 10:15:05 +01:00
Christian Schneider
f380bea81d Support metrics from arithmetic expressions.
This change adds the new metric config option `expression` which can
define a complex expression to calculate the final metric value. The
expression is evaluated using github.com/antonmedv/expr as the engine,
see expr-lang.org/docs/v1.9/Language-Definition for a language overview.
In addition, some basic functions are available during evaluation: now,
int, float, round, ceil, floor, abs, min, max.

For each evaluation, the expression gets:
- the current MQTT value
- the last MQTT value
- the result of the last evaluation
- the elapsed time since the last evaluation

Expressions allow more flexibility to derive metrics from sensor inputs
which are very hard or even impossible to do in Prometheus, for example,
integrate continuous values over time, filter extreme or zero values, or
non-linear scaling. The last value, result, and timestamp are preserved
even between restarts of mqtt2prometheus. This means that expressions
can be used to produce continuous time series over a long time range.

To make upstream integration easier, the code depends on the rather old
v1.8.9 of github.com/antonmedv/expr, which is available in the main repo
of all supported Debian versions.
2024-03-25 10:15:05 +01:00
Christoph Petrausch
0191b7b263 Don't enable experimental docker features in release process v0.1.8-RC2 2024-03-25 05:49:10 +01:00
Christoph Petrausch
20da3216ef Bump go versions used in tests and builds 2024-03-25 05:41:08 +01:00
Christoph Petrausch
66d4028eff Merge pull request #141 from chrschn/monotonic_gauge
Add option to enforce strict monotonicy in metrics
2024-03-25 05:33:34 +01:00
Renovate Bot
0eba231132 Update dependency prom/prometheus to v2.51.0 2024-03-19 14:28:49 +00:00
Ivan Podorozhnyi
8b38164ec4 Update Readme.md 2024-03-01 23:20:14 +01:00
Renovate Bot
8a476678d3 Update dependency golang to v1.22 2024-02-07 14:27:51 +00:00
chrschn
72289eeb10 Merge branch 'master' into monotonic_gauge 2024-02-05 22:15:55 +01:00
Christian Schneider
84ed960831 Restrict to Go 1.14 functionality 2024-02-05 21:56:40 +01:00
Christian Schneider
4943c97963 Add option to enforce strict monotonicy in metrics.
This change adds the new option `force_monotonicy` to metric
configurations. It is intended for almost-but-not-really monotinic
sources, such as counters which reset when the sensor is restarted.

When this option is set to `true`, the source metric value is regularly
written to disk. This allows us to detect and compensate counter resets
even between restarts. When a reset is detected, the last value before
the reset becomes the new offset, which is added to the metric value
going forth.  The result is a strictly monotonic time series, like an
ever increasing counter.
2024-02-05 21:04:52 +01:00
Christoph Petrausch
5c1917ff68 Bump action versions 2024-02-05 21:04:52 +01:00
Christoph Petrausch
c071e92223 Fix go releaser config 2024-02-05 21:04:52 +01:00
Christoph Petrausch
6e9f1a21af Fix goreleaser deprecation 2024-02-05 21:04:52 +01:00
Christoph Petrausch
7419ffac11 Bump to Go 1.21 in tests in relase 2024-02-05 21:04:52 +01:00
Christoph Petrausch
70de9d66d7 Bump newest version to go 1.21 in tests 2024-02-05 21:04:52 +01:00
Renovate Bot
a963576416 Update dependency prom/prometheus to v2.48.1 2024-02-05 21:04:52 +01:00