Can you create a Prometheus exporter so I can write data to the Prometheus database?
I mainly want to use Grafana to track the incoming and outgoing traffic for each IP address.
TBH I got neither the prerequisite experience with Prometheus nor the abundance of time. So unfortunately I think you'll have to DIY, but I would welcome PRs.
The easiest way to do it yourself is to parse bandwhich --raw output, ideally it would output json or something but the current format is not that bad either, and then map that to Grafana
TBH I got neither the prerequisite experience with Prometheus nor the abundance of time. So unfortunately I think you'll have to DIY, but I would welcome PRs.
I have completed the secondary development of bandwhich, implementing a Prometheus exporter-like functionality.
The command execution remains unchanged when no parameters are provided, preserving the original features. By adding the --enable-metrics flag, Prometheus exporter support is activated, and the --metrics-port option allows specifying a custom port (default set to 9200).
Example:
Finally, Grafana connects to the Prometheus database for visualization.