Skip to content
This repository was archived by the owner on Feb 20, 2026. It is now read-only.

Commit aa0cf52

Browse files
committed
fix(output/prometheus-sd): int labels not allowed ...
1 parent 124215f commit aa0cf52

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

output/prometheus-sd/output.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ type Output struct {
1111
output.Output
1212
path string
1313
targetType TargetAddressType
14-
labels map[string]interface{}
14+
labels map[string]string
1515
}
1616

1717
type Config map[string]interface{}
@@ -55,9 +55,9 @@ func (c Config) TargetAddress() TargetAddressType {
5555
return TargetAddressIP
5656
}
5757

58-
func (c Config) Labels() map[string]interface{} {
58+
func (c Config) Labels() map[string]string {
5959
if v, ok := c["labels"]; ok {
60-
return v.(map[string]interface{})
60+
return v.(map[string]string)
6161
}
6262
return nil
6363
}
@@ -82,16 +82,16 @@ func Register(configuration map[string]interface{}) (output.Output, error) {
8282

8383
type Targets struct {
8484
Targets []string `json:"targets"`
85-
Labels map[string]interface{} `json:"labels,omitempty"`
85+
Labels map[string]string `json:"labels,omitempty"`
8686
}
8787

88-
func toTargets(n *runtime.Node, defaultLabels map[string]interface{}, targetFunc TargetAddressFunc) *Targets {
88+
func toTargets(n *runtime.Node, defaultLabels map[string]string, targetFunc TargetAddressFunc) *Targets {
8989
target := targetFunc(n)
9090
if target == "" {
9191
return nil
9292
}
9393

94-
labels := map[string]interface{}{}
94+
labels := map[string]string{}
9595
for k, v := range defaultLabels {
9696
labels[k] = v
9797
}
@@ -120,10 +120,10 @@ func toTargets(n *runtime.Node, defaultLabels map[string]interface{}, targetFunc
120120

121121
// wireless - airtime
122122
if wifi := ni.Wireless; wifi != nil {
123-
labels["wifi_txpower24"] = wifi.TxPower24
124-
labels["wifi_channel24"] = wifi.Channel24
125-
labels["wifi_txpower5"] = wifi.TxPower5
126-
labels["wifi_channel5"] = wifi.Channel5
123+
labels["wifi_txpower24"] = string(wifi.TxPower24)
124+
labels["wifi_channel24"] = string(wifi.Channel24)
125+
labels["wifi_txpower5"] = string(wifi.TxPower5)
126+
labels["wifi_channel5"] = string(wifi.Channel5)
127127
}
128128
}
129129
return &Targets{

0 commit comments

Comments
 (0)