Prometheus Storj-Exporter

Solved it by let the python-script run on a different host.

thanks for monitoring :3

1 Like

Hello, after the last update of the win gui 0.35.3 version, storj-exporter.py stopped working and reports the following errors:
Traceback (most recent call last):

File “C:\Users\ruben\Downloads\Storj-Exporter-0.2.4\Storj-Exporter-0.2.4\storj-exporter.py”, line 104, in
REGISTRY.register(StorjCollector())
File “C:\Users\ruben\AppData\Local\Programs\Python\Python38-32\lib\site-packages\prometheus_client\registry.py”, line 24, in register
names = self._get_names(collector)
File “C:\Users\ruben\AppData\Local\Programs\Python\Python38-32\lib\site-packages\prometheus_client\registry.py”, line 64, in get_names
for metric in desc_func():
File “C:\Users\ruben\Downloads\Storj-Exporter-0.2.4\Storj-Exporter-0.2.4\storj-exporter.py”, line 57, in collect
self.data = self.get_data()
File “C:\Users\ruben\Downloads\Storj-Exporter-0.2.4\Storj-Exporter-0.2.4\storj-exporter.py”, line 18, in get_data
return self.call_api(“dashboard”)[‘data’]
File “C:\Users\ruben\Downloads\Storj-Exporter-0.2.4\Storj-Exporter-0.2.4\storj-exporter.py”, line 15, in call_api
return response.json()
File “C:\Users\ruben\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\models.py”, line 897, in json
return complexjson.loads(self.text, **kwargs)
File "C:\Users\ruben\AppData\Local\Programs\Python\Python38-32\lib\json_init
.py", line 357, in loads
return _default_decoder.decode(s)
File “C:\Users\ruben\AppData\Local\Programs\Python\Python38-32\lib\json\decoder.py”, line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “C:\Users\ruben\AppData\Local\Programs\Python\Python38-32\lib\json\decoder.py”, line 355, in raw_decode
raise JSONDecodeError(“Expecting value”, s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Thank you! It works. Unfortunately uptime graph is zero but maybe its because my node is new on network…

It needs to be updated to the latest version. see the PR in the github repository.

1 Like

that is normal because the uptime implementation has changed and is still not active in the storagenode. So until this is completely implemented in the storagenode, that graph will stay at 0.

1 Like

Thank you very much, it already works

ive nothing change on my nodes and systems, but ive since 3 hours HTTP 500 error on all nodes. ive check the nodes, and there are still runing smooth… ive reboot some nodes but the error is still there

500 message: error generating metric output.

You’ve updated your storage node on docker.
Version 0.35.3 changes the dashboard API.

I don’t establish if it can be just fixed changing the endpoint of the script in Storj-exporter, now.

In the repository there is a PR changing the endpoint. Apparently it seems to work but haven’t tried it myself yet since my nodes didn’t update yet

I would also appreciate a fix for the new storagenode version :slight_smile:

The fix is up. Even with the new docker image for the exporter.

ive stop and remove the old container, but the new container don’t run on my nodes.

I try this command:

docker run -d --link=storagenode --name=storj-exporter -p 9651:9651 anclrii/storj-exporter:latest

did you pull the latest image first?

OMG -.- im stupid ^^^^^^^^^^

I didn’t have much time to follow up here lately. I merged the api fix into master and pushed new latest docker image so you can update as needed. Default watchtower only monitors storagenode updates so may need to pull manually.

1 Like

Thank you for the fix. Works like a charm :+1:

I don’t understand why but I can’t get the exporter working.
I did launch the docker image successfully (I assume since there is nothing in the log).
When I add the prometheus source in grafana, it is accepted but when I explore the source, there is no metrics at all.

I did a nmap of the container and I see that BaseHTTPServer 0.6 Python 3.7.7 is running on port 9651.
But it look like the db is empty.

storj node : v1.0.1
grafana : 6.7.1

Regards,
xk3tchuPx

As you don’t mention your Prometheus version, is it running?
Do you see any metrics at your at Prometheus Endpoint? (depending on your config localhost:9651/metrics) ?
What are your exporter arguments?

@revyte
You were right the issue was on prometheus side.
Now that it’s working, I discovered 3 smalls bugs:

  • Grafana : When you import the dashboard in grafana, if your default db isn’t a prometheus db, it’s not gonna work.
  • Storj-Exporter : The storage used gauge only report the used space, not considering the total space.
  • Storj-Exporter : Uptime score report 0.
    When I inspect the metrics, I can notice that the uptime is above zero. Maybe it’s the query?

I’m only allowed to add one image per post so I merged them all.

Regards,
xk3tchuPx