cloud: enable prometheus server
This makes cloud components start a Prometheus server on a separate port
(:4243 by default) using either gRPC TLS credentials or plain HTTP.
The Prometheus server currently only export the standard Go/Process
metrics that the default Prometheus library exports.
Change-Id: I9f2ae20c34446c0e10a946d4a93251764f5d2fce
Reviewed-on: https://review.monogon.dev/c/monogon/+/1599
Reviewed-by: Leopold Schabel <leo@monogon.tech>
Tested-by: Jenkins CI
diff --git a/cloud/bmaas/server/server.go b/cloud/bmaas/server/server.go
index 0aeefad..8867e4f 100644
--- a/cloud/bmaas/server/server.go
+++ b/cloud/bmaas/server/server.go
@@ -145,6 +145,8 @@
// Start the BMaaS Server in background goroutines. This should only be called
// once. The process will exit with debug logs if starting the server failed.
func (s *Server) Start(ctx context.Context) {
+ s.Config.Component.StartPrometheus(ctx)
+
conn, err := s.Config.BMDB.Open(true)
if err != nil {
klog.Exitf("Failed to connect to BMDB: %v", err)