Skip to content

Commit

Permalink
Change default port as suggested in prometheus/docs#1649
Browse files Browse the repository at this point in the history
Updated documentation
  • Loading branch information
Christoph Petrausch committed Jun 9, 2020
1 parent 443f437 commit 451f4c0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# MQTT2Prometheus
![](https://github.com/hikhvar/mqtt2prometheus/workflows/tests/badge.svg) ![](https://github.com/hikhvar/mqtt2prometheus/workflows/release/badge.svg)
This exporter is an analog to the [Prometheus Pushgateway](https://github.com/prometheus/pushgateway). Clients can push
This exporter translates from MQTT topics to prometheus metrics. The core design is that clients send arbitrary JSON messages
on the topics. The translation is programmed into the mqtt2prometheus since we often can not change the IoT devices sending
the messages. Clients can push
metrics via MQTT to an MQTT Broker. This exporter subscribes to the broker and
publish the received messages as prometheus metrics. I wrote this exporter to publish
metrics from small embedded sensors based on the NodeMCU to prometheus. The used arduino scetch can be found in the [dht22tomqtt](https://github.com/hikhvar/dht22tomqtt) repository.
Expand Down Expand Up @@ -42,7 +44,7 @@ make build

To start the public available image run:
```bash
docker run -it -v "$(pwd)/config.yaml:/config.yaml" -p 8002:8002 hikhvar/mqtt2prometheus:latest
docker run -it -v "$(pwd)/config.yaml:/config.yaml" -p 8002:8002 docker.pkg.github.com/hikhvar/mqtt2prometheus/mqtt2prometheus:latest
```

#### Build The Image locally
Expand Down Expand Up @@ -71,7 +73,7 @@ Usage of ./mqtt2prometheus.linux_amd64:
-listen-address string
listen address for HTTP server used to expose metrics
-listen-port string
HTTP port used to expose metrics (default "8002")
HTTP port used to expose metrics (default "9641")
```

Expand All @@ -93,7 +95,7 @@ cache:
# This is a list of valid metrics. Only metrics listed here will be exported
metrics:
# The name of the metric in prometheus
- prom_name: temperature
- prom_name: temperature_celsius
# The name of the metric in a MQTT JSON message
mqtt_name: temperature
# The prometheus help text for this metric
Expand Down
2 changes: 1 addition & 1 deletion cmd/mqtt2prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var (
)
portFlag = flag.String(
"listen-port",
"8002",
"9641",
"HTTP port used to expose metrics",
)
addressFlag = flag.String(
Expand Down

0 comments on commit 451f4c0

Please sign in to comment.