Merge pull request #631 from austinbrowder/master

Added source interface identifier to exportUSGstats function
This commit is contained in:
Cody Lee 2023-11-08 19:40:19 -06:00 committed by GitHub
commit db5a268271
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -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},