# Prometheus Storj-Exporter

**URL:** <https://forum.storj.io/t/prometheus-storj-exporter/1939>\
**Category:** getting started\
**Tags:** monitoring\
**Created:** [September 26, 2019, 10:39am UTC](https://forum.storj.io/t/prometheus-storj-exporter/1939 "2019-09-26T10:39:28Z")\
**Posts on this page:** 20\
**Page:** 6

<div class="post-metadata">

**Author:** ![Cross91](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/cross91/32/1139_2.png) [@Cross91](https://forum.storj.io/u/Cross91)\
**Post date:** [February 26, 2020, 2:11pm UTC](https://forum.storj.io/t/prometheus-storj-exporter/1939/105 "2020-02-26T14:11:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![katelinlis](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/katelinlis/32/1138_2.png) [@katelinlis](https://forum.storj.io/u/katelinlis)\
**Post date:** [March 24, 2020, 10:13am UTC](https://forum.storj.io/t/prometheus-storj-exporter/1939/106 "2020-03-24T10:13:43Z")

</div>

![image](https://storj-s3.bcdn.literatehosting.net/original/2X/6/6712caa6bc0d19551067656f663b06a87785f6b8.png)

thanks for monitoring :3

---

<div class="post-metadata">

**Author:** ![rafh69](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/rafh69/32/1127_2.png) [@rafh69](https://forum.storj.io/u/rafh69)\
**Post date:** [March 26, 2020, 2:05pm UTC](https://forum.storj.io/t/prometheus-storj-exporter/1939/107 "2020-03-26T14:05:26Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![ufo56](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/ufo56/32/1140_2.png) [@ufo56](https://forum.storj.io/u/ufo56)\
**Post date:** [March 26, 2020, 2:19pm UTC](https://forum.storj.io/t/prometheus-storj-exporter/1939/108 "2020-03-26T14:19:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![kevink](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/kevink/32/6077_2.png) [@kevink](https://forum.storj.io/u/kevink)\
**Post date:** [March 26, 2020, 2:51pm UTC](https://forum.storj.io/t/prometheus-storj-exporter/1939/109 "2020-03-26T14:51:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![kevink](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/kevink/32/6077_2.png) [@kevink](https://forum.storj.io/u/kevink)\
**Post date:** [March 26, 2020, 2:52pm UTC](https://forum.storj.io/t/prometheus-storj-exporter/1939/110 "2020-03-26T14:52:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rafh69](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/rafh69/32/1127_2.png) [@rafh69](https://forum.storj.io/u/rafh69)\
**Post date:** [March 26, 2020, 3:09pm UTC](https://forum.storj.io/t/prometheus-storj-exporter/1939/111 "2020-03-26T15:09:51Z")

</div>

Thank you very much, it already works

---

<div class="post-metadata">

**Author:** ![amnesia106](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/amnesia106/32/70_2.png) [@amnesia106](https://forum.storj.io/u/amnesia106)\
**Post date:** [March 28, 2020, 12:29am UTC](https://forum.storj.io/t/prometheus-storj-exporter/1939/112 "2020-03-28T00:29:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![gorillanet](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/gorillanet/32/1124_2.png) [@gorillanet](https://forum.storj.io/u/gorillanet)\
**Post date:** [March 28, 2020, 2:09am UTC](https://forum.storj.io/t/prometheus-storj-exporter/1939/113 "2020-03-28T02:09:41Z")

</div>

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

> [@Changelog v0.35.3](https://forum.storj.io/t/changelog-v0-35-3/5267):
>
> For Storage Node Operators webUI dashboard notification (outdated version) On the storage node webUI dashboard you will see a notification if your storage node is running an outdated version. The first time you might be able to notice that will be the following release. Bandwidth limits removed Storage nodes don’t have a bandwidth limit anymore. We removed it from the CLI and webUI dashboard. The old configuration value has no effect anymore and the storage node will keep accepting uploads…

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

---

<div class="post-metadata">

**Author:** ![kevink](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/kevink/32/6077_2.png) [@kevink](https://forum.storj.io/u/kevink)\
**Post date:** [March 28, 2020, 6:43am UTC](https://forum.storj.io/t/prometheus-storj-exporter/1939/114 "2020-03-28T06:43:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![hewicker](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/hewicker/32/1122_2.png) [@hewicker](https://forum.storj.io/u/hewicker)\
**Post date:** [March 28, 2020, 4:44pm UTC](https://forum.storj.io/t/prometheus-storj-exporter/1939/115 "2020-03-28T16:44:35Z")

</div>

I would also appreciate a fix for the new storagenode version 🙂

---

<div class="post-metadata">

**Author:** ![kevink](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/kevink/32/6077_2.png) [@kevink](https://forum.storj.io/u/kevink)\
**Post date:** [March 28, 2020, 6:14pm UTC](https://forum.storj.io/t/prometheus-storj-exporter/1939/116 "2020-03-28T18:14:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![amnesia106](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/amnesia106/32/70_2.png) [@amnesia106](https://forum.storj.io/u/amnesia106)\
**Post date:** [March 28, 2020, 9:39pm UTC](https://forum.storj.io/t/prometheus-storj-exporter/1939/117 "2020-03-28T21:39:02Z")

</div>

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
```

---

<div class="post-metadata">

**Author:** ![kevink](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/kevink/32/6077_2.png) [@kevink](https://forum.storj.io/u/kevink)\
**Post date:** [March 28, 2020, 9:40pm UTC](https://forum.storj.io/t/prometheus-storj-exporter/1939/118 "2020-03-28T21:40:31Z")

</div>

did you pull the latest image first?

---

<div class="post-metadata">

**Author:** ![amnesia106](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/amnesia106/32/70_2.png) [@amnesia106](https://forum.storj.io/u/amnesia106)\
**Post date:** [March 28, 2020, 9:45pm UTC](https://forum.storj.io/t/prometheus-storj-exporter/1939/119 "2020-03-28T21:45:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![greener](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/greener/32/62_2.png) [@greener](https://forum.storj.io/u/greener)\
**Post date:** [March 29, 2020, 9:20am UTC](https://forum.storj.io/t/prometheus-storj-exporter/1939/120 "2020-03-29T09:20:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![hewicker](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/hewicker/32/1122_2.png) [@hewicker](https://forum.storj.io/u/hewicker)\
**Post date:** [March 30, 2020, 6:37am UTC](https://forum.storj.io/t/prometheus-storj-exporter/1939/121 "2020-03-30T06:37:11Z")

</div>

Thank you for the fix. Works like a charm 👍

---

<div class="post-metadata">

**Author:** ![xk3tchuPx](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/xk3tchupx/32/1127_2.png) [@xk3tchuPx](https://forum.storj.io/u/xk3tchuPx)\
**Post date:** [April 2, 2020, 8:47pm UTC](https://forum.storj.io/t/prometheus-storj-exporter/1939/122 "2020-04-02T20:47:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![revyte](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/revyte/32/1127_2.png) [@revyte](https://forum.storj.io/u/revyte)\
**Post date:** [April 3, 2020, 12:22pm UTC](https://forum.storj.io/t/prometheus-storj-exporter/1939/123 "2020-04-03T12:22:30Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![xk3tchuPx](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/xk3tchupx/32/1127_2.png) [@xk3tchuPx](https://forum.storj.io/u/xk3tchuPx)\
**Post date:** [April 4, 2020, 5:01pm UTC](https://forum.storj.io/t/prometheus-storj-exporter/1939/124 "2020-04-04T17:01:35Z")

</div>

@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.

 ![sat_uptime](https://storj-s3.bcdn.literatehosting.net/original/2X/1/140263bb518529d830fe8741dafee05a2f2a863c.png)

Regards,  
xk3tchuPx

[Previous page](https://forum.storj.io/t/prometheus-storj-exporter/1939.md?page=5)

[Next page](https://forum.storj.io/t/prometheus-storj-exporter/1939.md?page=7)
