From edb905170855c05cf36e25b315bd39f072c583ab Mon Sep 17 00:00:00 2001 From: Rahix Date: Sun, 10 Nov 2024 02:04:31 +0100 Subject: [PATCH] succd: Export temperature values to prometheus Also add metrics for all the temperature and humidity measurements. --- succbone/succd/http.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/succbone/succd/http.go b/succbone/succd/http.go index 9a43281..01eab8e 100644 --- a/succbone/succd/http.go +++ b/succbone/succd/http.go @@ -233,6 +233,26 @@ func (s *webServer) viewMetrics(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "# HELP sem_vacuum_high_reached Whether a high vacuum has been reached (boolean)\n") fmt.Fprintf(w, "# TYPE sem_vacuum_high_reached gauge\n") fmt.Fprintf(w, "sem_vacuum_high_reached %f\n", boolToFloat(high)) + + fmt.Fprintf(w, "# HELP sem_environment_temperature_celsius Environmental temperature of the SEM, in degrees celsius\n") + fmt.Fprintf(w, "# TYPE sem_environment_temperature_celsius gauge\n") + fmt.Fprintf(w, "sem_environment_temperature_celsius %f\n", state.tempSEM) + + fmt.Fprintf(w, "# HELP sem_environment_humidity_percent Environmental relative humidity of the SEM, in percent\n") + fmt.Fprintf(w, "# TYPE sem_environment_humidity_percent gauge\n") + fmt.Fprintf(w, "sem_environment_humidity_percent %f\n", state.humiditySEM) + + fmt.Fprintf(w, "# HELP sem_dp_bottom_temperature_celsius Temperature of the DP bottom, in degrees celsius\n") + fmt.Fprintf(w, "# TYPE sem_dp_bottom_temperature_celsius gauge\n") + fmt.Fprintf(w, "sem_dp_bottom_temperature_celsius %f\n", state.tempDPBottom) + + fmt.Fprintf(w, "# HELP sem_dp_top_temperature_celsius Temperature of the DP top, in degrees celsius\n") + fmt.Fprintf(w, "# TYPE sem_dp_top_temperature_celsius gauge\n") + fmt.Fprintf(w, "sem_dp_top_temperature_celsius %f\n", state.tempDPTop) + + fmt.Fprintf(w, "# HELP sem_dp_inlet_temperature_celsius Temperature of the DP inlet flange, in degrees celsius\n") + fmt.Fprintf(w, "# TYPE sem_dp_inlet_temperature_celsius gauge\n") + fmt.Fprintf(w, "sem_dp_inlet_temperature_celsius %f\n", state.tempDPInlet) } func (s *webServer) viewRoughingPumpEnable(w http.ResponseWriter, r *http.Request) {