mqtt2prometheus icon indicating copy to clipboard operation
mqtt2prometheus copied to clipboard

API Port as an environment variable + Dockerfile added for Arm32v7 and Arm64v8

Open rezahili opened this issue 1 year ago • 2 comments
trafficstars

Using multiple MQTT2Prometheus containers in the same network or subscribing to different topics can be handled by utilizing environment variables for the API Port. Creating images for Arm32v7 and Arm64v8 could be helpful because we use a lot of IoT devices which are based on ARM architecture.

rezahili avatar Mar 22 '24 21:03 rezahili

Hello,

the released docker image should already support the two architectures you are mentioning. This repository uses goreleaser to build a single multi-arch image. https://github.com/hikhvar/mqtt2prometheus/blob/master/.goreleaser.yml#L94

Regarding the port: I don't understand why you need this remapping in the docker context? In every docker deployment tool you can easily remap the exposed port to a port in the container. The port in the container can be equal for all deployed instances. Except you run in host networking mode. But then, you can also use the CLI flags to change the port. If we introduce the possebility to set a flag via environment variable we should do it for all flags and provide a consistent schema for doing so.

hikhvar avatar Mar 25 '24 04:03 hikhvar

Hello,

Thank you for bringing up the matter regarding the Docker images. You are correct; I haven't been able to locate the goreleaser in the repository.

Regarding the port issue, yes, I did utilize it in network host mode as I required multiple instances of the exporter.

In terms of pipelines, it's common practice to employ environment variables. Additionally, it might be beneficial to include CLI documentation for clarity.

Would you be agreeable to adding environment variables for all of them? If so, please let me know your thoughts on this proposal.

Thank you.

rezahili avatar Mar 25 '24 06:03 rezahili

This pull request will bring environment variables for CLI flags: https://github.com/hikhvar/mqtt2prometheus/pull/152

hikhvar avatar Jan 07 '25 21:01 hikhvar