Commit Graph

18 Commits

Author SHA1 Message Date
Christoph Petrausch
a4caaf59e0 Remove unused interface 2020-11-08 22:50:26 +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
25f213a37e Please the linter 2020-10-29 21:10:48 +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
dc07489237 Fix Sprintf 2020-09-19 23:41:55 +02:00
Christoph Petrausch
31b233b4b0 Support multiple mqtt2prometheus instances per host by incorporate the pid into the mqtt client ID 2020-09-19 23:39:22 +02:00
Christoph Petrausch
9e4ab531b7 Add version flag to commandline 2020-09-19 20:07:33 +02:00
Christoph Petrausch
f13c36ab4a Breaking: Don't append + automatically to the topic 2020-07-18 18:17:29 +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
627c52669a Update hack config 2020-07-16 14:42:38 +02:00
Christoph Petrausch
ecb0011f3f Merge pull request #13 from hikhvar/fix-docs
Change default port as suggested in https://github.com/prometheus/doc…
2020-06-09 16:18:45 +02:00
Christoph Petrausch
451f4c0ce1 Change default port as suggested in https://github.com/prometheus/docs/pull/1649
Updated documentation
2020-06-09 16:18:11 +02:00
Mansour Behabadi
8d0c1e0f2b gofmt cmd/ 2020-05-22 00:43:09 +10:00
Christoph Petrausch
0b308a5ea3 Remove unused package 2020-04-21 22:07:31 +02:00
AchMenz
9ab1d2b479 time not only in minutes 2020-03-17 17:46:30 +01:00
AchMenz
9318832599 fixed cache-duration-always-lasts-2-minutes bug
- the metrics were always presented 2 minutes, regardless what values have been loaded from the config file
- now the values from the config file are reflected in the behavior
2020-02-28 23:35:36 +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