Skip to content

Add remote host to all promethus fields that report stats for wireguard interfaces #111

@AI7NC

Description

@AI7NC

Is your feature request related to a problem? Please describe.
Many of the prometheus metrics are tied to the networking interface name. Currently when you disable a tunnel in the gui, all tunnels > than the disabled tunnel shift assignments.

If you disable GGS4, then WGS5 becomes WGS4, WGS6 becomes WGS5...

If you're trying to match node names to interface names in some of the metrics that don't include the node name on the other side in the data line, this disrupts the mapping for all nodes with an interface # greater than the interface # that is disabled.

A prometheus metric example that has this issue is 'node_network_transmit_bytes_total' and node_network_receive_bytes_total'

Describe the solution you'd like
Include the hostname of the device on the other side of the WGS/WGC tunnel for all promethus metrics the currently only report out by instance + device. An example of what this would look like is below.

Current: node_network_receive_bytes_total{device="wgc1"} 2401160924

Suggested: node_network_receive_bytes_total{device="wgc1",remotehost="ai7nc-tunsrv"} 2401160924

Having the remote host would allow you to filter charts based on hostname which won't change when you enable/disable tunnels. This way assignments for chart data won't shift every time you enable/disable existing tunnels.

Describe alternatives you've considered
We're tried to find a way to join current WGC/WGS interfaces to the node on the other side but no field we could find in the /cgi-bin/metrics json included both for association. That solution would also be needlessly clunky as most of the folks using prometheus aren't DBAs.

Additional context
Comprehensive list of metrics in /cgi-bin/metrics that only allow filtering by wg interface that would be beneficial to also include a 'remote node' field.

Line  385: node_network_address_assign_type{device="wgc1"} 0
Line  412: node_network_carrier{device="wgc1"} 1
Line  440: node_network_carrier_changes_total{device="wgc1"} 0
Line  468: node_network_carrier_down_changes_total{device="wgc1"} 0
Line  496: node_network_carrier_up_changes_total{device="wgc1"} 0
Line  524: node_network_device_id{device="wgc1"} 0
Line  551: node_network_dormant{device="wgc1"} 0
Line  579: node_network_flags{device="wgc1"} 145
Line  607: node_network_iface_id{device="wgc1"} 23
Line  635: node_network_iface_link{device="wgc1"} 23
Line  663: node_network_iface_link_mode{device="wgc1"} 0
Line  691: node_network_info{address="",broadcast="",device="wgc1",duplex="",ifalias="",operstate="unknown"} 1
Line  719: node_network_mtu_bytes{device="wgc1"} 1420
Line  742: node_network_name_assign_type{device="wgc1"} 3
Line  770: node_network_netdev_group{device="wgc1"} 0
Line  798: node_network_protocol_type{device="wgc1"} 65534
Line  826: node_network_receive_bytes_total{device="wgc1"} 2401160924
Line  854: node_network_receive_compressed_total{device="wgc1"} 0
Line  882: node_network_receive_drop_total{device="wgc1"} 0
Line  910: node_network_receive_errors_total{device="wgc1"} 190201
Line  938: node_network_receive_fifo_errors_total{device="wgc1"} 0
Line  966: node_network_receive_frame_errors_total{device="wgc1"} 190201
Line  994: node_network_receive_multicast_total{device="wgc1"} 0
Line 1022: node_network_receive_packets_total{device="wgc1"} 3754587
Line 1066: node_network_transmit_bytes_total{device="wgc1"} 4954783432
Line 1094: node_network_transmit_carrier_errors_total{device="wgc1"} 0
Line 1122: node_network_transmit_collision_errors_total{device="wgc1"} 0
Line 1150: node_network_transmit_compressed_total{device="wgc1"} 0
Line 1178: node_network_transmit_drop_total{device="wgc1"} 10690
Line 1206: node_network_transmit_errors_total{device="wgc1"} 0
Line 1234: node_network_transmit_fifo_errors_total{device="wgc1"} 0
Line 1262: node_network_transmit_packets_total{device="wgc1"} 5529996
Line 1290: node_network_up{device="wgc1"} 0

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions