Skip to content

Commit

Permalink
Added source interface identifier to exportUSGstats function
Browse files Browse the repository at this point in the history
  • Loading branch information
austinbrowder committed Oct 23, 2023
1 parent cd1a4ac commit 746ab85
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/promunifi/usg.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Check failure on line 117 in pkg/promunifi/usg.go

View workflow job for this annotation

GitHub Actions / lint (1.20, ubuntu-latest)

declarations should never be cuddled (wsl)
if st.SourceInterface != "" {

Check failure on line 118 in pkg/promunifi/usg.go

View workflow job for this annotation

GitHub Actions / lint (1.20, ubuntu-latest)

only one cuddle assignment allowed before if statement (wsl)
sourceInterface = st.SourceInterface
} else {
sourceInterface = "all"
}
labelWan := []string{sourceInterface, labels[1], labels[2], labels[3]}

Check failure on line 123 in pkg/promunifi/usg.go

View workflow job for this annotation

GitHub Actions / lint (1.20, ubuntu-latest)

assignments should only be cuddled with other assignments (wsl)

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

0 comments on commit 746ab85

Please sign in to comment.