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
This commit is contained in:
nutcas3
2026-04-25 03:28:26 +03:00
parent 121cb60a62
commit fff289f957
2 changed files with 3 additions and 0 deletions
+1
View File
@@ -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
)
+2
View File
@@ -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")
{