From fff289f957e3b11f81feb311c16b38f2f23d3e13 Mon Sep 17 00:00:00 2001 From: nutcas3 Date: Sat, 25 Apr 2026 03:28:26 +0300 Subject: [PATCH] feat: Add Prometheus metrics endpoint to carrier-connector - Add prometheus/client_golang v1.20.5 dependency to go.mod - Add /api/v1/metrics endpoint using promhttp.Handler() wrapped with gin.WrapH --- apps/carrier-connector/go.mod | 1 + apps/carrier-connector/routes.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/apps/carrier-connector/go.mod b/apps/carrier-connector/go.mod index 96010f0..0af2bfb 100644 --- a/apps/carrier-connector/go.mod +++ b/apps/carrier-connector/go.mod @@ -5,6 +5,7 @@ go 1.26 require ( github.com/go-resty/resty/v2 v2.17.2 github.com/joho/godotenv v1.5.1 + github.com/prometheus/client_golang v1.20.5 github.com/rs/zerolog v1.35.0 ) diff --git a/apps/carrier-connector/routes.go b/apps/carrier-connector/routes.go index e86808f..1fc8d57 100644 --- a/apps/carrier-connector/routes.go +++ b/apps/carrier-connector/routes.go @@ -5,6 +5,7 @@ import ( "time" "github.com/gin-gonic/gin" + "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/nutcas3/telecom-platform/apps/carrier-connector/internal/es2" handler "github.com/nutcas3/telecom-platform/apps/carrier-connector/internal/handler" @@ -17,6 +18,7 @@ func setupRoutes(router *gin.Engine, client *es2.ES2Client, repo repository.Prof api.GET("/health", healthHandler) api.GET("/health/ready", readinessHandler(repo)) api.GET("/health/live", livenessHandler) + api.GET("/metrics", gin.WrapH(promhttp.Handler())) esim := api.Group("/esim") {