anclrii / Storj-Exporter

Prometheus exporter for monitoring Storj storage nodes
GNU General Public License v3.0
59 stars 19 forks source link

Storj metrics missing when is custom name for storagenode is used #50

Closed Samgarr closed 3 years ago

Samgarr commented 3 years ago

Hello, i think easiest option instalation doesn't export storagenode metrics if storagenode using custom name for container.

CONTAINER ID   IMAGE                          COMMAND                  CREATED              STATUS              PORTS                                                  NAMES
e25e997bebc2   storjlabs/storagenode:latest   "/entrypoint"            13 hours ago         Up 13 hours         127.0.0.1:14002->14002/tcp, 0.0.0.0:28967->28967/tcp   storj32

Docker container for storj-exporter have "STORJ_HOST_ADDRESS=storagenode", which does not exists.

"Env": [               
  "PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
  "LANG=C.UTF-8",      
  "GPG_KEY=0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D",
  "PYTHON_VERSION=3.7.9",
  "PYTHON_PIP_VERSION=20.2.4",
  "PYTHON_GET_PIP_URL=https://github.com/pypa/get-pip/raw/fa7dc83944936bf09a0e4cb5d5ec852c0d256599/get-pip.py",                                                                                       
  "PYTHON_GET_PIP_SHA256=6e0bb0a2c2533361d7f297ed547237caf1b7507f197835974c0dd7eba998c53c",
  "STORJ_HOST_ADDRESS=storagenode",
  "STORJ_API_PORT=14002",
  "STORJ_EXPORTER_PORT=9651"
],

After fixing this ENV variable everything works. It would be nice mention this directly in README.

anclrii commented 3 years ago

Thanks, I will update the readme to make it more clear and add some examples for multiple nodes.

Currently STORJ_HOST_ADDRESS is mentioned here along with other env vars which you can set on the docker command line with -e STORJ_HOST_ADDRESS=<ip or name of storagenode container>" to override the default

anclrii commented 3 years ago

https://github.com/anclrii/Storj-Exporter/commit/3397b94b418c5ee024a84537428525a56d41771a

Samgarr commented 3 years ago

Thank you!