Prometheus Storj-Exporter

No. How am I supposed to do that? I am running two nodes on the same ip. Should I run the following?

sudo docker run -d --link=storagenode1 --name=storj-exporter1 -p 9652:9652 anclrii/storj-exporter:latest

… and edit config.yml as per Krawi’s post above?

I tried this but prometheus would still show 1 node.

yes but you have to use a different port for each node and set up scraping for that port in prometheus

I do not know what I am doing wrong, but I can’t get it to work.

  1. Setting up the container with Storj-Exporter: Works! I can access the data via my browser

  2. I’ve set up another host where I installed prometheus and grafana. I have added the following in the bottom of prometheus.yml:

 - job_name: storj
    static_configs:
      - targets: ['storagenode:9651']

Restarting prometheus works.

  1. Adding a new datasource to the grafana dashboard:
http://localhost:9090

According to grafana, the datasource “works”

  1. Importing the dashboard in grafana works too, but all the data is wrong, so I assume that Grafana is getting the wrong data

  2. This also appear, and I have no idea what this means :slight_smile:
    image

Thank you for you time!

/ Grafana beginner

Correct me if wrong, but this meant to be:

Dont forget to stop prometheus before editing the prometheus.jml. And of course start after editing.
Hope it works now.

I am not running prometheus on the same node as storj where the Storj-Exporter resides, that’s why I defined it like this.

Then replace localhost with the ip of the system where the exporter runs.

That is exactly what this is.

So I run the two following commands:

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

sudo docker run -d --link=storagenode1 --name=storj-exporter1 -p 9652:9651 anclrii/storj-exporter:latest

My yml config file looks like this:

  • job_name: storj
    static_configs:
    • targets: [‘localhost:9651’]
      labels:
      instance: ‘storagenode0’
    • targets: [‘localhost:9652’]
      labels:
      instance: ‘storagenode1’

I can see my first node storagenode0, however no luck with storagenode1. Port 14003 is open for storagenode1 and I can access it without any issue.

I have a feeling that this tool may better work for people who maintain nodes on different servers than for people who maintain more than one on a single server :frowning:

did you do that in grafana?

maybe in the storj-exporter1 docker command need to add STORJ_API_PORT = 14003:

sudo docker run -d --link=storagenode1 --name=storj-exporter1 -p 9652:9651 -e STORJ_API_PORT=14003 anclrii/storj-exporter:latest

Hi, thanks, looks great, is there a step by step installation guide somewhere?

I need to add one and didn’t have time lately, but any generic guide for installing prometheus/grafana should work. I’m using ansible to set this up similar to https://github.com/prometheus/demo-site.

Has anybody an idea, how to get the new uptime score over prometheus in grafana?
The Cause is cleard in that tread.

I’d like to have it again shown in my grafana dashboard.
Thanks.

2 Likes

the new system isn’t correctly working yet. So no need to add it

I’ll update exporter once the new metric is confirmed. It’s showing 0 for me as well.

Finally got the service file and additional README information submitted in PRs. Let me know if the PR for the service file is too messy and I will redo it on my end. Not a whole lot of experience collaborating on projects in GitHub, so please do let me know if they are ok or need to be redone, I definitely do not mind.

1 Like

Looks good to me, 2 things I could add:

  1. You didn’t enable the service to start at boot: systemctl enable storj_exporter
  2. If the storj exporter fails for some reason (e.g. storagenode gets updated, does the exporter crash in that case?) it won’t get restarted. It might be worth adding a restart into the service or the exporter has to be resilient enough to not crash if the connection to the storagenode doesn’t work.

Thanks for the quick feedback.

  1. I did include the enable into the instructions, it is in the PR #14 as I forgot it in PR #13. Learned a bit more about doing proper git branching and such so that PR is exclusively the README improvements. Figure I will probably just cancel #13 and redo it better to only have the service file.

  2. Definitely need to do more testing and validation of how it handles those types of situations and adjust the service files accordingly. This was built off of my own barebones systemd template that I use for all my own custom services, more improvements will be coming in now that I have learned a decent bit about collaborative git versus just doing my own personal repos for change tracking.

Ah sounds good, apparently I only read PR13 :smiley: Thanks

Yeah git is great for collaboration, good to learn it now.

Resubmitted with a cleaner PR (https://github.com/anclrii/Storj-Exporter/pull/15). Also included automatic restarts on failure.