Files
houston-be/internal/metrics/server.go
Abhijeet Gupta 60ff45be60 TP-0000 | Metric setup And On Call Add And Fkey (#18)
* TP-0000 | Metric setup

* TP-0000 | adding oncall

* TP-0000 | fkey
2023-04-19 20:26:37 +05:30

18 lines
343 B
Go

package metrics
import (
"fmt"
"github.com/gin-gonic/gin"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/spf13/viper"
)
func AdminHandler() {
ginServer := gin.New()
ginServer.GET("/metrics", gin.WrapH(promhttp.Handler()))
go func() {
ginServer.Run(fmt.Sprintf(":%v", viper.GetString("metrics.port")))
}()
}