Commit Graph
26 Commits
Author SHA1 Message Date
yan 51b627abce Handle json payload in metric_per_topic mode 2023-04-19 01:06:13 +02:00
Will Moss 173eebe9be Check for specifying both *_per_topic_config in config 2023-01-01 11:48:09 -08:00
alessandro negrin a76297e47c optional ts in metrics 2022-11-30 10:02:48 +01:00
alessandro negrin d077874127 scale as unsigned float; tests for values from string or boolean 2022-11-29 10:33:55 +01:00
alessandro negrin 740352bc00 scaling option for MQTT values 2022-11-28 18:39:39 +01:00
Christoph PetrauschandGitHub 25115cf80a Fix struct tags 2021-12-25 08:34:56 +01:00
michey 4f1b56fe2f Add way to change default separator for json pathes 2021-12-24 23:39:43 +03:00
Chris Aumann 366c38c791 Use UnmarshalStrict for config file to catch config errors 2021-03-14 14:09:53 +01:00
weboo d5ee3e68f9 support for TLS client certificates 2021-03-12 21:51:57 +09:00
Christoph Petrausch 3bd83c1d9b Add more tests 2021-03-08 20:44:53 +01:00
Chris Aumann 5b0603c32d Make GroupValue() more resilient 2021-03-06 18:39:02 +01:00
Christoph Petrausch 24df81ed32 Add fuzzing 2021-02-14 20:47:41 +01:00
Christoph Petrausch be4af9ff5e Refactor metric extraction from MQTT
This commit allows to extract the metric name from the topic path. Now
it can be configured if all metrics are in a object in a certain topic
or if every topic contains exactly one metric. However, currently these
modes can not be mixed.

This should solve !26

TODO:
* Update documentation
* Add unit tests
2020-11-08 22:01:36 +01:00
Christoph Petrausch 126e13428b Use go.uber.org/zap for logging
As mentioned in https://github.com/hikhvar/mqtt2prometheus/issues/23, we
do not use any logging framework at all. This was fine for getting the
exporter startet. However, with inreasing load the logging must be
configureable. This PR is a start to replace all instances of
"log.Printf" with the zap logger. The current configuration parameters
are the log level and the log format (console, json). We might expose
the log configuration to the config file. But I think this is overkill
for the current state of the exporter.
2020-10-29 20:58:28 +01:00
Christoph Petrausch 800b8c0cc5 Append source topic to metrics 2020-07-18 18:28:52 +02:00
Christoph Petrausch 5680206095 Support arbitrary position of device id in topic
The device firmware tasmota places the device ID in the middle of the
topic path. To support those devices to this commit introduce the
device_id_regex configuration. The old behavior of the last element of
the topic path is unchanged.
2020-07-18 18:02:17 +02:00
Christoph Petrausch ec23d61881 Rename RegexpFilter to use it for device id extraction too 2020-07-18 18:02:17 +02:00
Mansour Behabadi 7b5796b042 Add sensor name filter config 2020-05-22 00:42:49 +10:00
Mansour BehabadiandGitHub 1ac6f71fa3 Fix typo 2020-05-03 18:29:15 +10:00
Mansour Behabadi 13c47b498d Parse more value types
* Parse bools as 0 for false and 1 for true
* Allow mapping between string and float values
2020-05-03 18:11:09 +10:00
AchMenzandGitHub 550dec1c42 fixed default time 2020-03-17 17:43:55 +01:00
AchMenzandGitHub 0953fbf647 fixed default time 2020-03-17 17:41:04 +01:00
AchMenzandGitHub 0d884b7d34 removed debug artifacts
- falsely committed some debug code -> removed it
2020-02-28 23:48:12 +01:00
AchMenzandGitHub fe7da9fcc8 fixed always loads CacheConfigDefaults bug
- previous code always loaded the cache default
- the time format in cache default should be plain integer
2020-02-28 23:30:18 +01:00
Paul Rogalinski-Pinter e2c1e26d3e auth config for mqtt, fixed error handling 2020-02-03 13:34:20 +01:00
Christoph Petrausch 7d41c58d70 Initial commit 2018-03-18 13:20:49 +01:00