Open rahmadsandy opened 2 years ago
Hello @rahmadsandy,
please correct me if I misunderstood. You are suggesting to persist the output of wg show all dump
to use in case wireguard is restarting?
sorry replying lately, yes correct @MindFlavor
but i have tried after restarting wireguard service wg show all dump
also resetting all data
We can cache the last wg show all dump
output but I am not sure it would help: the counters will get reset anyway at the next poll. I'll try and think about an alternative. If anyone in the community can chip in, it would be most welcome!
thank you @MindFlavor still waiting your progress 🚀
I'm in the same scenario. I would like to keep stats.
Maybe you can store last stats and:
For wireguard_sent_bytes_total: If new_wireguard_sent_bytes_total < last_wireguard_sent_bytes_total then wireguard_sent_bytes_total = new_wireguard_sent_bytes_total + last_wireguard_sent_bytes_total else wireguard_sent_bytes_total = new_wireguard_sent_bytes_total
For wireguard_received_bytes_totall: If new_wireguard_received_bytes_total < last_wireguard_received_bytes_total then wireguard_received_bytes_total = new_wireguard_received_bytes_total + last_wireguard_received_bytes_totall else wireguard_received_bytes_tota l= new_wireguard_received_bytes_total
For wireguard_latest_handshake_seconds:l: If new_wireguard_latest_handshake_seconds > last_wireguard_latest_handshake_seconds then wireguard_sent_bytes_total = last_wireguard_sent_bytes_total else wireguard_latest_handshake_seconds = new_wireguard_latest_handshake_seconds
What do you think?
Hello @MindFlavor , honesty this amazing project
could this exporter save all metrics from the beginning with ignoring how often we restarted wireguard interface? or could be store stats into file or some databases
i used this wireguard framework to manage https://github.com/vx3r/wg-gen-web everytime do CUD (Create, Update and Delete) automatically restart wireguard interface
i think its could be good if this exporter could save from beginning depends from exporter systemd file status