Skip to content

metrics: Report if attached to interface

Vgutierrez requested to merge report_attached into main

Report if tcp-mss-clamper is attached to each configured interface. This will allow alerting if attaching to one or more interfaces fails.

Examples:

vgutierrez@carrot:~/gitlab.wikimedia.org/sre/tcp-mss-clamper$ sudo ./tcp-mss-clamper -i lo -s 127.0.0.1:22 --ipv4-mss 1480 --ipv6-mss 1440 -p :8888
2024/04/24 16:32:45 eBPF program supports up to 8 sources
2024/04/24 16:32:45 Unable to attach to lo: clsact qdisc not found on lo

gets reported as:

vgutierrez@carrot:~$ curl 127.0.0.1:8888/metrics -s |grep tcp_mss_clamper_attached
# HELP tcp_mss_clamper_attached Reports whether it's currently attached to a configured interface
# TYPE tcp_mss_clamper_attached gauge
tcp_mss_clamper_attached{interface="lo"} 0

Successful execution gets reported like this:

vgutierrez@carrot:~$ curl 127.0.0.1:8888/metrics -s |grep tcp_mss_clamper_attached
# HELP tcp_mss_clamper_attached Reports whether it's currently attached to a configured interface
# TYPE tcp_mss_clamper_attached gauge
tcp_mss_clamper_attached{interface="lo"} 1

Merge request reports