From 746ab856e005f31b1f57eb7676431342353b1780 Mon Sep 17 00:00:00 2001 From: Austin Browder <30290145+austinbrowder@users.noreply.github.com> Date: Mon, 23 Oct 2023 14:39:22 -0600 Subject: [PATCH] Added source interface identifier to exportUSGstats function --- pkg/promunifi/usg.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/promunifi/usg.go b/pkg/promunifi/usg.go index 947ac164..bfccae37 100644 --- a/pkg/promunifi/usg.go +++ b/pkg/promunifi/usg.go @@ -114,7 +114,13 @@ func (u *promUnifi) exportUSGstats(r report, labels []string, gw *unifi.Gw, st u } labelLan := []string{"lan", labels[1], labels[2], labels[3]} - labelWan := []string{"all", labels[1], labels[2], labels[3]} + var sourceInterface string + if st.SourceInterface != "" { + sourceInterface = st.SourceInterface + } else { + sourceInterface = "all" + } + labelWan := []string{sourceInterface, labels[1], labels[2], labels[3]} r.send([]*metric{ {u.USG.LanRxPackets, counter, gw.LanRxPackets, labelLan},