Hello I have several nodes on different PI’s. Everywhere is the logexporter and node exporter installed. On my main PC I have installed Prometheus and grafana. Every time I start the main computer the data from the nodes are displayed again.
Now to my question. Is there any way to save the old data in grafana or set Prometheus/Grafana to keep the old data and not always redo everything?
Depends on how you installed it.
If you use a docker version, then you need to either bind your local folder for Prometheus/Grafana data or use a docker volume.
If you installed Prometheus as a standalone service, it should not lose your previous data, unless you configured retention period too short.
ok that’s good only unfortunately when i open grafana the data bar starts from new. And not with interruption. So so to speak PC off Prometheus off. PC on again and Prometheus collects data again. That’s ok, although I would like Prometheus to look through the nodelogs and update them during the time it was off. But if I then go to Grafana, Grafana also starts again.
It doesn’t work this way. Prometheus exporters have a “short memory” (buffer) to collect unsent metrics, if they are not gathered by Prometheus before the buffer is full, they are dropped.
So you need to have your Prometheus up and running 24/7 if you want to have all metrics.
And why does Prometheus have the option that you can save the data, for example 365 days? Can I then pick up this data somewhere via grafana?
Yes, select an older period in the date picker. Of course you need to have the old data in the Prometheus’s database. It’s not a time machine and cannot collect data from periods before its install and configuration.
So if I understand correctly it would make more sense to hold back the data for maximum 1 to 2 days because the rest is useless to save memory and to work effectively.