add service type label

This commit is contained in:
tchivert committed 2023-11-09 12:11:07 +01:00
1 parent 654d605271
commit 929d90baa3
1 file changed
+2 -2
+2 -2
View File
@@ -38,7 +38,7 @@ var (
Name: "service_latency_seconds",
Help: "Latency of services.",
},
[]string{"service"},
[]string{"service", "type"},
)
addr = flag.String("a", "0.0.0.0", "address to use")
port = flag.String("p", "9062", "port to run on")
@@ -154,7 +154,7 @@ func checkLatency() {
duration = time.Since(start)
}
latency.With(prometheus.Labels{"service": service.Name}).Set(duration.Seconds())
latency.With(prometheus.Labels{"service": service.Name, "type": service.Type}).Set(duration.Seconds())
if *debug == true {
log.Printf("DEBUG: Latency %s: %v seconds", service.Name, duration.Seconds())
}