Prometheus exporter to Grafana

Hi, I’m searching a way to export my collectd data to grafana, I followed this tutorial: https://grafana.com/blog/2021/02/09/how-i-monitor-my-openwrt-router-with-grafana-cloud-and-prometheus/ and the stats are working locally but I’m not understanding how to export them to my Grafana account.

in the details I’m not understanding this part:

remote_write:
        - url: https://prometheus-us-central1.grafana.net/api/prom/push
          basic_auth:
            username: [Your Grafana Cloud UserID]
            password: [Your Grafana Cloud API Key]

Where I have to insert my Grafana details? Inside the /etc/config/prometheus-node-exporter-lua?
I think I have to write inside the prometheus.yaml configuration file. But, where’s this file?!

Maybe there’re other packages that need to be installed on the router?

Thanks

Are you saying this file is missing; or that you don't know how to look for it?

This file should be on the server.

1 Like

Yes, only now I understand that I have also to install the “Prometheus” package from opkg and configure it. Because otherwise there’isn’t a premetheus server.

I’ve done it, installed the package on the R7800 OpenWRT router, found the file, configured it.

Still it doesn’t update the Grafana page, probably I’ve made something wrong but I stopped all because I think this is not the correct way to do this. I don’t want to install a Prometheus server or my OpenWRT router. I just want to export the data of it.

Since I have some Raspberry PI that I can use as Prometheus server, I think the best way is to install Prometheus on a Raspberry PI and then export the OpenWRT stats to it, and from the Raspberry PI push it to Grafana cloud or install Grafana directly on it.

It’s “more” correct?

I’m just having some troubles to understand why collectd can’t export directly the data to Grafana cloud. Or to another similar platform. Because I have a lot of collectd data stored in a USB device (via rrdTool). There’s is the output plug-in but looks like it need a Influxdb server.

I also don’t know what’s the best way: influxdb and grafana or Prometheus and grafana?

Thanks

It's more common to run servers on computing hardware than on an embedded networking device. Specifically, I'm not familiar with your device or the resources this software takes - so I'm unsure if it would run well installed on your router anyway.

Because you want to run Prometheus - and it need a server to run the client software on the router, you noted this yourself:

1 Like

Okay understand, thanks again.

But what you think: better to install InfluxDB or Prometheus on a RPi 4B?

Again, see:

So yes, I'd suggest the Pi over the router itself.

Run Dietpi on your raspberry pi rather than stuffing around with the raw raspberrypi install. It has a pre configured install for influxdb and grafana available via a couple of clicks.
Then run collectd on you openwrt devices and configure them to send data to the raspberrypi influxdb instance. Pretty much just involves setting the 'network IP' address for the pi server. You can configure everything on the openwrt from the gui if you want to avoid the cli.

2 Likes

Oh, thanks I had not thought about it, I'm already using DietPI on my RPi, I have only to run sudo dietpi-software :grinning: