mirror of
https://github.com/unpoller/unpoller.git
synced 2026-03-31 06:24:19 -04:00
fix: rename unused exportWithTags param to _ to satisfy revive
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -77,13 +77,14 @@ func (u *promUnifi) exportUDM(r report, d *unifi.UDM) {
|
|||||||
|
|
||||||
baseLabels := []string{d.Type, d.SiteName, d.Name, d.SourceName}
|
baseLabels := []string{d.Type, d.SiteName, d.Name, d.SourceName}
|
||||||
baseInfoLabels := []string{d.Version, d.Model, d.Serial, d.Mac, d.IP, d.ID}
|
baseInfoLabels := []string{d.Version, d.Model, d.Serial, d.Mac, d.IP, d.ID}
|
||||||
|
|
||||||
// Export metrics with tags - create separate series for each tag
|
// Export metrics with tags - create separate series for each tag
|
||||||
u.exportWithTags(r, d.Tags, func(tagLabels []string) {
|
u.exportWithTags(r, d.Tags, func(tagLabels []string) {
|
||||||
tag := tagLabels[0]
|
tag := tagLabels[0]
|
||||||
labels := baseLabels
|
labels := baseLabels
|
||||||
|
|
||||||
infoLabels := append(baseInfoLabels, tag)
|
infoLabels := append(baseInfoLabels, tag)
|
||||||
|
|
||||||
// Shared data (all devices do this).
|
// Shared data (all devices do this).
|
||||||
u.exportBYTstats(r, append(labels, tag), d.TxBytes, d.RxBytes)
|
u.exportBYTstats(r, append(labels, tag), d.TxBytes, d.RxBytes)
|
||||||
u.exportSYSstats(r, append(labels, tag), d.SysStats, d.SystemStats)
|
u.exportSYSstats(r, append(labels, tag), d.SysStats, d.SystemStats)
|
||||||
@@ -129,10 +130,11 @@ func (u *promUnifi) exportUDM(r report, d *unifi.UDM) {
|
|||||||
|
|
||||||
// exportWithTags exports metrics with tag support. If device has multiple tags,
|
// exportWithTags exports metrics with tag support. If device has multiple tags,
|
||||||
// each tag creates a separate metric series. If no tags, exports with tag="".
|
// each tag creates a separate metric series. If no tags, exports with tag="".
|
||||||
func (u *promUnifi) exportWithTags(r report, tags []string, fn func([]string)) {
|
func (u *promUnifi) exportWithTags(_ report, tags []string, fn func([]string)) {
|
||||||
if len(tags) == 0 {
|
if len(tags) == 0 {
|
||||||
// No tags - export once with empty tag
|
// No tags - export once with empty tag
|
||||||
fn([]string{""})
|
fn([]string{""})
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// Multiple tags - export once per tag
|
// Multiple tags - export once per tag
|
||||||
|
|||||||
Reference in New Issue
Block a user