metanull-operator / eth2-grafana

Grafana dashboards for Eth2.
68 stars 16 forks source link

ETH Price is always N/A #10

Open arobbins opened 2 years ago

arobbins commented 2 years ago

First, thanks for the killer dashboard.

The only thing I can't seem to get working is the ETH price feed. I've followed the installation instructions multiple times, but it always shows N/A.

Screen Shot 2022-06-18 at 3 04 38 PM

I'm running Ubuntu Server 22.04 LTS with ufw enabled. I've opened port 7979.

I'm using json_exporter version 0.4.0.

Any ideas?

metanull-operator commented 2 years ago

They changed the syntax of their configuration file. It took me far too long to reconcile their documentation against the realities of their code. In any case, this is fixed in the instructions. Please replace the contents of the json_exporter.yml file with the following and let me know if you have further problems.

metrics:
  - name: ethusd
    path: "$.ethereum.usd"
    help: "Ethereum (ETH) price in USD"
arobbins commented 2 years ago

Thanks for the fast response!

I've made that update, but no luck. I tried restarting the following services as well:

json.exporter.service prometheus.service

I opened the panel settings and noticed that the metric field is empty. Is that normal?

Screen Shot 2022-06-18 at 4 55 16 PM

metanull-operator commented 2 years ago

No, not normal. I would just re-import the dashboard. My best guess is that the query disappeared as you were trying to debug. I just imported a fresh copy and the query is present.

arobbins commented 2 years ago

Does it matter if I'm using Nimbus?

I just deleted my dashboard and imported the Nimbus one without any luck: https://github.com/metanull-operator/eth2-grafana/blob/master/nimbus/eth2-grafana-nimbus-dashboard.json

metanull-operator commented 2 years ago

For this issue, I do not believe it matters. The setup and query for ETH price should be identical for both. In fact, I installed the Nimbus dashboard in Grafana and the price immediately appeared for me.

I did not state it explicitly before, but did you try restarting json_exporter after updating the configuration file?

If you followed my instructions for installing and running json_exporter: sudo systemctl restart json_exporter

metanull-operator commented 2 years ago

I corrected the Nimbus documentation with the most recent commit... 9cb68106bab90fe6b7014822175dec96fce3a5c3

arobbins commented 2 years ago

Thanks for helping out earlier. I finally have some time to revisit again.

I did what you recommended but still no luck. I completely removed my dashboard and uploaded it again. I also restarted json_exporter.

Below is what my Nimbus dashboard looks like now. I'm noticing the uptime card is N/A now too.

I'm wondering if there's some kind of Grafana log I can look at to check for query errors? Perhaps there's an error showing up somewhere but I can't see it.

Screen Shot 2022-07-02 at 1 53 51 PM

arobbins commented 2 years ago

I got the beacon uptime panel to work by editing the panel options. I changed the Fields option to Numeric fields.

Now still debugging the price :)

Screen Shot 2022-07-03 at 5 55 27 PM

KEEZ-RobG commented 2 years ago

Hello, was this resolved? I'm having the same issue.

arobbins commented 2 years ago

Nope, still seeing the issue on my end. Decided to move on but would love to see it fixed.

metanull-operator commented 2 years ago

It looks like the json_exporter team changed their configuration file format again. Can you both tell me which versions of json_exporter you are currently running?

arobbins commented 2 years ago

Looks like I'm using 0.4.0

KEEZ-RobG commented 2 years ago

I was on .4 and upgraded to .5 yesterday. I know people who still have it working, and I'm reaching out to see which version they have. I'll let you know. Thank you for taking the time. 🙏

KEEZ-RobG commented 2 years ago

It’s working on version 0.4

metanull-operator commented 2 years ago

Here is what I have for /etc/json_exporter/json_exporter.yml on my system running 0.5.0...

modules:
  default:
    metrics:
    - name: ethusd
      path: "{.ethereum.usd}"
      help: Ethereum (ETH) price in USD

To edit: sudo nano /etc/json_exporter/json_exporter.yml

Restart json_exporter after updating that file with sudo systemctl restart json_exporter.

KEEZ-RobG commented 2 years ago

I did not have the first two lines, but the rest was the same. I changed it, but still the same result. What I have noticed: this only happens when someone does a fresh install .. completes the whole guide. The timing of this breaking also doesn't seem to coincide with new releases from the json_exporter team. Could it possibly be an update to prometheus? It's not grafana. Prometheus reports: "server returned HTTP status 400 Bad Request" on the targets dashboard for json. json_exporter does not have an error.

KEEZ-RobG commented 2 years ago

Screenshot from 2022-08-02 10-39-46

metanull-operator commented 2 years ago

I'll run through everything again to see if I have any problems. What OS are you on? I can even start from a fresh install to match what you have.

Do you see anything in your json_exporter logs?

sudo journalctl -u json_exporter -n 200

KEEZ-RobG commented 2 years ago

Screenshot from 2022-08-08 16-12-04

metanull-operator commented 2 years ago

Where it says "Loaded config file" in the logs, the text scrolls off the screen. Just so I can see how the configuration is loaded, can you copy the rest of that line here?

What OS are you on?

metanull-operator commented 2 years ago

I just ran through my instructions and was successful in getting the eth price. I did update the instructions with the latest config file format, as discussed previously. And I updated the instructions to use more recent version of all software. I see nothing specifically wrong with the instructions here that would cause problems.

Can you tell me what you see when you go to this URL:

Do you get anything when you run this command:

curl http://127.0.0.1:7979/probe?target=https%3A%2F%2Fapi.coingecko.com%2Fapi%2Fv3%2Fsimple%2Fprice%3Fids%3Dethereum%26vs_currencies%3Dusd

Do you see port 7979 listening when you run this command:

netstat -tnlp
cbet0 commented 2 years ago

I had this same issue before, updated with the instructions here and it works. Also opened UFW for port 7979 udp and tcp... not sure if that helped thou. I am using Ubuntu Server 22.04 and json_exporter 0.5 as of time of writting this