diff --git a/output/prometheus-sd/output.go b/output/prometheus-sd/output.go index 47e95d2..696908b 100644 --- a/output/prometheus-sd/output.go +++ b/output/prometheus-sd/output.go @@ -2,6 +2,7 @@ package prometheus_sd import ( "errors" + "fmt" "strconv" "github.com/FreifunkBremen/yanic/output" @@ -120,6 +121,12 @@ func toTargets(n *runtime.Node, defaultLabels map[string]interface{}, targetFunc labels["owner"] = owner.Contact } + // location + if location := ni.Location; location != nil { + labels["latitude"] = fmt.Sprintf("%v", location.Latitude) + labels["longitude"] = fmt.Sprintf("%v", location.Longitude) + } + // wireless - airtime if wifi := ni.Wireless; wifi != nil { labels["wifi_txpower24"] = strconv.Itoa(int(wifi.TxPower24))