MindFlavor / prometheus_wireguard_exporter

A Prometheus exporter for WireGuard, written in Rust.
https://mindflavor.github.io/prometheus_wireguard_exporter
MIT License
493 stars 51 forks source link

Implement friendly_json tag witch may work like friendly_name #54

Closed iqdoctor closed 3 years ago

iqdoctor commented 3 years ago

please implement friendly_json which may work like friendly_name

[Peer]
#friendly_name = OnePlus 5T
PublicKey = 928vO9Lf4+Mo84cWu4k1oRyzf0AR7FTGoPKHGoTMSHk=
AllowedIPs = 10.70.0.80/32

[Peer]
# friendly_json={"id":482217555,"username":"DrProxyMeCoordinator", "first_name": "Coordinator", "last_name": "DrProxy.me" ,"auth_date":1614869789}
PublicKey = TNDmhUqiPBv7vTtbQ26H0v4DIdU6WuiTgRIzIAoD+D0=
# HELP wireguard_sent_bytes_total Bytes sent to the peer
# TYPE wireguard_sent_bytes_total counter
wireguard_sent_bytes_total{interface="wg0",public_key="928vO9Lf4+Mo84cWu4k1oRyzf0AR7FTGoPKHGoTMSHk=",allowed_ips="10.70.0.80/32",friendly_name="OnePlus 5T"} 0
wireguard_sent_bytes_total{interface="wg0",public_key="TNDmhUqiPBv7vTtbQ26H0v4DIdU6WuiTgRIzIAoD+D0=",allowed_ips="10.70.0.5/32",id=482217555,username=DrProxyMeCoordinator,first_name="Coordinator,last_name="DrProxy.me",auth_date=1614869789} 0
# HELP wireguard_received_bytes_total Bytes received from the peer
# TYPE wireguard_received_bytes_total counter
wireguard_latest_handshake_seconds{interface="wg0",public_key="928vO9Lf4+Mo84cWu4k1oRyzf0AR7FTGoPKHGoTMSHk=",allowed_ips="10.70.0.80/32",friendly_name="OnePlus 5T"} 0
wireguard_latest_handshake_seconds{interface="wg0",public_key="TNDmhUqiPBv7vTtbQ26H0v4DIdU6WuiTgRIzIAoD+D0=",allowed_ips="10.70.0.5/32",id=482217555,username=DrProxyMeCoordinator,first_name="Coordinator,last_name="DrProxy.me",auth_date=1614869789} 0
# HELP wireguard_latest_handshake_seconds Seconds from the last handshake
# TYPE wireguard_latest_handshake_seconds gauge
wireguard_latest_handshake_seconds{interface="wg0",public_key="928vO9Lf4+Mo84cWu4k1oRyzf0AR7FTGoPKHGoTMSHk=",allowed_ips="10.70.0.80/32",friendly_name="OnePlus 5T"} 0
wireguard_latest_handshake_seconds{interface="wg0",public_key="TNDmhUqiPBv7vTtbQ26H0v4DIdU6WuiTgRIzIAoD+D0=",allowed_ips="10.70.0.5/32",id=482217555,username=DrProxyMeCoordinator,first_name="Coordinator,last_name="DrProxy.me",auth_date=1614869789} 0
MindFlavor commented 3 years ago

I think it's an excellent idea! 👍

Will do!