This fixes an issue where the exporter would fail to work if a user
attempted to monitor multiple OpenVPN processes in server mode as the
metrics would clash without the status_path label.
This resulted in the exporter failing and returning a HTTP 500.
# curl localhost:9176/metrics
An error has occurred during metrics gathering:
collected metric openvpn_openvpn_server_connected_clients gauge:<value:2 > was collected before with the same name and label values
After fix:
# curl localhost:9176/metrics 2>/dev/null | grep connected_clients
# HELP openvpn_openvpn_server_connected_clients Number Of Connected Clients
# TYPE openvpn_openvpn_server_connected_clients gauge
openvpn_openvpn_server_connected_clients{status_path="/var/log/openvpn-status-server.log"} 1
openvpn_openvpn_server_connected_clients{status_path="/var/log/openvpn-status-server2.log"} 1
This fixes an issue where the exporter would fail to work if a user attempted to monitor multiple OpenVPN processes in server mode as the metrics would clash without the status_path label. This resulted in the exporter failing and returning a HTTP 500.
Before the fix:
After fix: