Skip to content

Commit

Permalink
feat(prometheus-sd): label for location
Browse files Browse the repository at this point in the history
  • Loading branch information
genofire committed Jul 11, 2022
1 parent 7c01dcb commit ca19fc7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions output/prometheus-sd/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ func toTargets(n *runtime.Node, defaultLabels map[string]interface{}, targetFunc
labels["owner"] = owner.Contact
}

// location
if location := ni.Location; location != nil {
labels["latitude"] = location.Latitude
labels["longitude"] = location.Longitude
}

// wireless - airtime
if wifi := ni.Wireless; wifi != nil {
labels["wifi_txpower24"] = strconv.Itoa(int(wifi.TxPower24))
Expand Down

0 comments on commit ca19fc7

Please sign in to comment.