haveachin / infrared

An ultra lightweight minecraft reverse proxy and idle placeholder
https://infrared.dev
GNU Affero General Public License v3.0
733 stars 60 forks source link

Unsure of where to pass the command line flags to enable the node_exporter functionality #118

Closed TheCrimsonLady closed 2 years ago

TheCrimsonLady commented 2 years ago

Describe the bug I am unable to get the node_exporter function to get to work since I don't know where I am supposed to add the command line flags, or where the infrared binary mentioned in the documentation is. Due to the lack of the CMD section in the Dockerfile, I am unsure where the command line flags need to go.

To Reproduce Deploying as normal Docker container (not Docker compose) on Debian 10.

Expected behavior Passing command line flags to enable the node_exporter function

Screenshots (Optional) I tried to pass the flags with the -e docker flag (to no avail), entering the container with a shell did not work either and I am unsure as if how to pass the command line flags to the RUN section in the Dockerfile

haveachin commented 2 years ago

@lhridder could you look into this?

lhridder commented 2 years ago

It seems like environment variables for this feature are not implemented yet: https://github.com/haveachin/infrared/blob/68b01d674d161f89f1899c5f352ece912fc16bd8/cmd/infrared/main.go#L60

TheCrimsonLady commented 2 years ago

It seems like environment variables for this feature are not implemented yet:

https://github.com/haveachin/infrared/blob/68b01d674d161f89f1899c5f352ece912fc16bd8/cmd/infrared/main.go#L60

Ok thanks for the clarification, that explains it

I'll close this issue

lhridder commented 2 years ago

If this is merged you can enable it with environment variables

TheCrimsonLady commented 2 years ago

If this is merged you can enable it with environment variables

I assume you mean with the -e Flags when deploying the Docker Container?

lhridder commented 2 years ago

Yes

TheCrimsonLady commented 2 years ago

Thanks a lot 😄

lhridder commented 2 years ago

This has now been merged into main :)

TheCrimsonLady commented 2 years ago

This has now been merged into main :)

Yeah I saw that earlier today, but I think I still pass the environment variable wrong. I redeployed my infrared container multiple times with the following commands (this is always only the last command the readme provides):

docker run -d --name infrared --restart=unless-stopped -it -v /usr/local/infrared/configs/:/configs -e enable-prometheus -e PROMETHEUS_ENABLED -p 25565:25565/tcp --expose 25565 haveachin/infrared:latest

docker rm infrared && docker run -d --name infrared --restart=unless-stopped -it -e PROMETHEUS_ENABLED -e enable-prometheus=true -v /usr/local/infrared/configs/:/configs -p 25565:25565/tcp --expose 25565 haveachin/infrared:latest

docker run -d --name infrared --restart=unless-stopped -it -e PROMETHEUS_ENABLED -e -enable-prometheus=true -v /usr/local/infrared/configs/:/configs -p 25565:25565/tcp --expose 25565 --expose 9100 -p 9100:9100/tcp -p 9100:9100/udp haveachin/infrared:latest

None of the commands seem to enable the Prometheus feature, according to my prometheus webUI (see attached image)

How exactly do you have to pass them?

Screenshot 2022-02-06 at 16 48 52
haveachin commented 2 years ago

I noticed that there are some issues with the building pipeline or are you building it from source?

TheCrimsonLady commented 2 years ago

No, I'm using the commands in the readme to deploy/update infrared. I just added the flags for prometheus

But building from source is another thing I wanted to open an issue on here, since I was unable to use my own fork to build the container. But I think I should do that in another issue

lhridder commented 2 years ago

Ah you should use INFRARED_PROMETHEUS_ENABLED=true and INFRARED_PROMETHEUS_BIND=":9100"

TheCrimsonLady commented 2 years ago

Oh ok, thanks for the tip! I'll try that once there are no players on my server anymore

Maybe change the readme to make this more clear because the wording right now is sorta ambiguous in contrast to your suggestion.

lhridder commented 2 years ago

Yes i forgot to add the new env variables to the readme, my bad

haveachin commented 2 years ago

Oh ok, thanks for the tip! I'll try that once there are no players on my server anymore

Maybe change the readme to make this more clear because the wording right now is sorta ambiguous in contrast to your suggestion.

There is also a complete rewrite on its way. So there will probably no new features or changes for the current version.