Skip to content

Commit

Permalink
Merge pull request #631 from austinbrowder/master
Browse files Browse the repository at this point in the history
Added source interface identifier to exportUSGstats function
  • Loading branch information
platinummonkey committed Nov 9, 2023
2 parents 6277e44 + 8974cce commit db5a268
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/promunifi/usg.go
Expand Up @@ -109,12 +109,20 @@ func (u *promUnifi) exportUSG(r report, d *unifi.USG) {

// Gateway Stats.
func (u *promUnifi) exportUSGstats(r report, labels []string, gw *unifi.Gw, st unifi.SpeedtestStatus, ul unifi.Uplink) {
var sourceInterface string

if st.SourceInterface != "" {
sourceInterface = st.SourceInterface
} else {
sourceInterface = "all"
}

if gw == nil {
return
}

labelLan := []string{"lan", labels[1], labels[2], labels[3]}
labelWan := []string{"all", labels[1], labels[2], labels[3]}
labelWan := []string{sourceInterface, labels[1], labels[2], labels[3]}

r.send([]*metric{
{u.USG.LanRxPackets, counter, gw.LanRxPackets, labelLan},
Expand Down

0 comments on commit db5a268

Please sign in to comment.