This commit is contained in:
2025-12-10 08:12:52 +02:00
parent 1d2c23440c
commit cbec350da2
15 changed files with 147 additions and 325 deletions

View File

@@ -9,14 +9,19 @@ import (
func main() {
router := gin.Default()
metricRouter := gin.Default()
metrics := ginmetrics.GetMonitor()
metrics.SetMetricPath("/metrics")
metrics.Use(router)
metrics.Expose(metricRouter)
router.GET("/api/v1/gin", func(c *gin.Context) {
c.String(http.StatusOK, "Hello " + os.Getenv("USERNAME") + " from " + os.Getenv("MY_POD_NAME") + " with log level " + os.Getenv("LOG_LEVEL"))
router.GET("/", func(c *gin.Context) {
c.String(http.StatusOK, "Hello " + os.Getenv("USERNAME") + " from " + os.Getenv("MY_POD_NAME"))
})
go func() {
_ = metricRouter.Run(":8080")
}()
router.Run(":8000")
}