mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-10-23 13:12:16 +00:00
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:
@@ -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
|
||||
)
|
||||
|
||||
|
||||
@@ -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")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user