Merge pull request #578 from unpoller/issue-575-influxdb-types-back-to-int

cast back to int64 so existing timeseries continue to ingest
This commit is contained in:
Cody Lee 2023-07-18 16:08:13 -05:00 committed by GitHub
commit bb8a2b91fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 38 additions and 38 deletions

View File

@ -34,7 +34,7 @@ func (u *InfluxUnifi) batchClient(r report, s *unifi.Client) { // nolint: funlen
"vlan": s.Vlan.Txt,
}
fields := map[string]any{
"anomalies": s.Anomalies,
"anomalies": s.Anomalies.Int64(),
"ip": s.IP,
"essid": s.Essid,
"bssid": s.Bssid,
@ -42,32 +42,32 @@ func (u *InfluxUnifi) batchClient(r report, s *unifi.Client) { // nolint: funlen
"hostname": s.Name,
"radio_desc": s.RadioDescription,
"satisfaction": s.Satisfaction.Val,
"bytes_r": s.BytesR,
"ccq": s.Ccq,
"noise": s.Noise,
"bytes_r": s.BytesR.Int64(),
"ccq": s.Ccq.Int64(),
"noise": s.Noise.Int64(),
"note": s.Note,
"powersave_enabled": s.PowersaveEnabled,
"roam_count": s.RoamCount,
"rssi": s.Rssi,
"rx_bytes": s.RxBytes,
"rx_bytes_r": s.RxBytesR,
"rx_packets": s.RxPackets,
"rx_rate": s.RxRate,
"signal": s.Signal,
"tx_bytes": s.TxBytes,
"tx_bytes_r": s.TxBytesR,
"tx_packets": s.TxPackets,
"roam_count": s.RoamCount.Int64(),
"rssi": s.Rssi.Int64(),
"rx_bytes": s.RxBytes.Int64(),
"rx_bytes_r": s.RxBytesR.Int64(),
"rx_packets": s.RxPackets.Int64(),
"rx_rate": s.RxRate.Int64(),
"signal": s.Signal.Int64(),
"tx_bytes": s.TxBytes.Int64(),
"tx_bytes_r": s.TxBytesR.Int64(),
"tx_packets": s.TxPackets.Int64(),
"tx_retries": s.TxRetries,
"tx_power": s.TxPower,
"tx_rate": s.TxRate,
"uptime": s.Uptime,
"tx_power": s.TxPower.Int64(),
"tx_rate": s.TxRate.Int64(),
"uptime": s.Uptime.Int64(),
"wifi_tx_attempts": s.WifiTxAttempts,
"wired-rx_bytes": s.WiredRxBytes,
"wired-rx_bytes-r": s.WiredRxBytesR,
"wired-rx_packets": s.WiredRxPackets,
"wired-tx_bytes": s.WiredTxBytes,
"wired-tx_bytes-r": s.WiredTxBytesR,
"wired-tx_packets": s.WiredTxPackets,
"wired-rx_bytes": s.WiredRxBytes.Int64(),
"wired-rx_bytes-r": s.WiredRxBytesR.Int64(),
"wired-rx_packets": s.WiredRxPackets.Int64(),
"wired-tx_bytes": s.WiredTxBytes.Int64(),
"wired-tx_bytes-r": s.WiredTxBytesR.Int64(),
"wired-tx_packets": s.WiredTxPackets.Int64(),
}
r.send(&metric{Table: "clients", Tags: tags, Fields: fields})
@ -100,10 +100,10 @@ func (u *InfluxUnifi) batchClientDPI(r report, v any, appTotal, catTotal totalsD
"source": s.SourceName,
},
Fields: map[string]any{
"tx_packets": dpi.TxPackets.Val,
"rx_packets": dpi.RxPackets.Val,
"tx_bytes": dpi.TxBytes.Val,
"rx_bytes": dpi.RxBytes.Val,
"tx_packets": dpi.TxPackets.Int64(),
"rx_packets": dpi.RxPackets.Int64(),
"tx_bytes": dpi.TxBytes.Int64(),
"rx_bytes": dpi.RxBytes.Int64(),
},
})
}
@ -167,10 +167,10 @@ func reportClientDPItotals(r report, appTotal, catTotal totalsDPImap) {
"source": controller,
},
Fields: map[string]any{
"tx_packets": m.TxPackets.Val,
"rx_packets": m.RxPackets.Val,
"tx_bytes": m.TxBytes.Val,
"rx_bytes": m.RxBytes.Val,
"tx_packets": m.TxPackets.Int64(),
"rx_packets": m.RxPackets.Int64(),
"tx_bytes": m.TxBytes.Int64(),
"rx_bytes": m.RxBytes.Int64(),
},
}
newMetric.Tags[k.kind] = name

View File

@ -23,8 +23,8 @@ func (u *InfluxUnifi) batchSite(r report, s *unifi.Site) {
"num_user": h.NumUser.Val,
"num_guest": h.NumGuest.Val,
"num_iot": h.NumIot.Val,
"tx_bytes-r": h.TxBytesR.Val,
"rx_bytes-r": h.RxBytesR.Val,
"tx_bytes-r": h.TxBytesR.Int64(),
"rx_bytes-r": h.RxBytesR.Int64(),
"num_ap": h.NumAp.Val,
"num_adopted": h.NumAdopted.Val,
"num_disabled": h.NumDisabled.Val,
@ -37,7 +37,7 @@ func (u *InfluxUnifi) batchSite(r report, s *unifi.Site) {
"gw_mem": h.GwSystemStats.Mem.Val,
"gw_uptime": h.GwSystemStats.Uptime.Val,
"latency": h.Latency.Val,
"uptime": h.Uptime.Val,
"uptime": h.Uptime.Int64(),
"drops": h.Drops.Val,
"xput_up": h.XputUp.Val,
"xput_down": h.XputDown.Val,
@ -74,10 +74,10 @@ func (u *InfluxUnifi) batchSiteDPI(r report, v any) {
"source": s.SourceName,
},
Fields: map[string]any{
"tx_packets": dpi.TxPackets.Val,
"rx_packets": dpi.RxPackets.Val,
"tx_bytes": dpi.TxBytes.Val,
"rx_bytes": dpi.RxBytes.Val,
"tx_packets": dpi.TxPackets.Int64(),
"rx_packets": dpi.RxPackets.Int64(),
"tx_bytes": dpi.TxBytes.Int64(),
"rx_bytes": dpi.RxBytes.Int64(),
},
})
}