kumina / openvpn_exporter

A Prometheus exporter for OpenVPN.
Apache License 2.0
214 stars 105 forks source link

Fix username/virtual address on server metrics #3

Closed xose closed 7 years ago

xose commented 7 years ago

username and virtual_address labels are swapped on server metrics:

$ ./prom-openvpn-exporter -openvpn.status_paths examples/server3.status

openvpn_server_client_received_bytes_total{...,username="0.0.0.0",virtual_address="UNDEF"} 6.93438277e+08
EdSchouten commented 7 years ago

Hi there!

I'm not 100% confident this fix is all right. The elements in the LabelColumns array should correspond with the labels specified right underneath in Metrics. I think there is a deeper issue here that this fix is trying to masquerade.

Could you send me an (anonymised) copy of your status file, so I can take a look?

Thanks, Ed

xose commented 7 years ago

The format is the same as server3.status example. I uploaded a copy here: https://gist.github.com/xose/0d489da425cb1a608f6cfb40a0240dab

Thanks for looking into it!

EdSchouten commented 7 years ago

Oh, wait. My bad. I was reading your diff the wrong way around. Your patch is entirely correct: it brings the column names in sync with the labels.