add: record sensors in metrics

This commit is contained in:
Charles Hathaway
2023-10-01 22:37:12 -07:00
parent ac4e32697c
commit dfb8584910
4 changed files with 107 additions and 2 deletions
+2
View File
@@ -8,6 +8,7 @@ import (
"connectrpc.com/grpcreflect"
servicepb "github.com/chathaway-codes/home-sensors/v2/gen/genconnect"
"github.com/chathaway-codes/home-sensors/v2/pkg/signaler"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/rs/cors"
"golang.org/x/net/http2"
"golang.org/x/net/http2/h2c"
@@ -55,6 +56,7 @@ func main() {
"Grpc-Message", // Required for gRPC-web
},
})
mux.Handle("/metrics", promhttp.Handler())
handler := corsHandler.Handler(mux)
server := &http.Server{