gravitl / netmaker

Netmaker makes networks with WireGuard. Netmaker automates fast, secure, and distributed virtual networks.
https://netmaker.io
Other
9.52k stars 552 forks source link

[Bug]: netmaker-exporter not using SERVER_BROKER_ENDPOINT env var #2237

Closed dgdewild closed 1 year ago

dgdewild commented 1 year ago

Contact Details

daan.de.wilde@fixling.be

What happened?

It seems the environmental variables for the netmaker-exporter service are not used, resulting in the service not being able to connect. As such this exporter service does not seem to be working and is unreachable in grafana.

based on docker-compose.yaml snippet:

netmaker-exporter:
    container_name: netmaker-exporter
    image: gravitl/netmaker-exporter:latest
    restart: always
    depends_on:
      - netmaker
    environment:
      SERVER_BROKER_ENDPOINT: "ws://mq:1883"
      BROKER_ENDPOINT: "wss://broker.<domain>"
      PROMETHEUS: "on"
      VERBOSITY: "1"
      API_PORT: "8085"
      LICENSE_KEY: "..."
      PROMETHEUS_HOST: https://prometheus.<domain>

I get the following logs for this service:

[netmaker-exporter] 2023-04-25 13:08:06 MQ Broker Endpoint  ws://<server-ip>:1884 
[netmaker] Fatal: could not connect to broker, token timeout, exiting ...

I would expect the MQ Broker Endpoint = ws://mq:1883, using the internal compose network, instead of ws://<server-ip>:1884

Version

v0.18.7

What OS are you using?

Linux

Relevant log output

[netmaker-exporter] 2023-04-25 13:08:06 MQ Broker Endpoint  ws://<server-ip>:1884 
[netmaker] Fatal: could not connect to broker, token timeout, exiting ...

Contributing guidelines

vxdzero commented 1 year ago

i confirm here, when add RCE: "on" in docker-compose.yml not make any change.

danonb commented 1 year ago

Looking at when that container was last published, is it expecting the MQ_HOST, MQ_PORT and MQ_SERVER_PORT environment variables instead?

abhishek9686 commented 1 year ago

@dgdewild This has been addressed already, please try out the latest release, and make sure you pull the latest image for netmaker-exporter