https://github.com/das6ng/mqtt2prom
subscribe mqtt topics and push them to prometheus metrics
https://github.com/das6ng/mqtt2prom
iot mqtt-bridge prometheus
Last synced: about 1 month ago
JSON representation
subscribe mqtt topics and push them to prometheus metrics
- Host: GitHub
- URL: https://github.com/das6ng/mqtt2prom
- Owner: das6ng
- License: mit
- Created: 2023-12-18T11:33:32.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-19T10:10:22.000Z (over 2 years ago)
- Last Synced: 2024-06-19T18:03:18.718Z (about 2 years ago)
- Topics: iot, mqtt-bridge, prometheus
- Language: Go
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mqtt2prom
subscribe mqtt topics and push them to prometheus metrics.
usage:
```
USAGE:
mqtt2prom [global options] command [command options] [arguments...]
COMMANDS:
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--config value, -c value specify config file (default: "config.yaml")
--help, -h show help
```
config:
```yaml
# mqtt broker url
mqtt_broker_url: mqtt://localhost:1883
# mqtt client id
mqtt_client_id: test_mqtt2prom
# subscribe topics/topic patterns
topics:
# normal topic
- "test_topic"
# topic pattern, I've tested it on mosquitto
- "/env/#"
# ignore topics, which wont push to prom push gateway
# MUST list one by one, no pattern
ignore_topics:
- "/env/debug"
# prom pushgateway url
pushgateway_url: http://localhost:9091
# prom push job name
push_job_name: "mqtt2prom"
# prom push job interval
push_interval: 10s
# prom clean job interval
clean_interval: 1m
# clean job will delete metrics which is no data in this duration.
clean_duration: 1h
# log level
log_level: DEBUG
```