Skip to content

Commit

Permalink
fix: don't do silly logging
Browse files Browse the repository at this point in the history
  • Loading branch information
djpiper28 committed Mar 3, 2024
1 parent b51481e commit dcce883
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions kube_cache/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"log"
"os"
"strings"

"github.com/CosmicKube/kube_cache/aiStuff"
"github.com/CosmicKube/kube_cache/model"
Expand Down Expand Up @@ -34,6 +35,22 @@ func main() {
router := gin.Default()

p := ginpromehteus.NewPrometheus("gin")
p.ReqCntURLLabelMappingFn = func(c *gin.Context) string {
url := c.Request.URL.Path
for _, p := range c.Params {
if p.Key == "id" {
url = strings.Replace(url, p.Value, ":id", 1)
break
} else if p.Key == "id1" {
url = strings.Replace(url, p.Value, ":id1", 1)
break
} else if p.Key == "id2" {
url = strings.Replace(url, p.Value, ":id2", 1)
break
}
}
return url
}
p.Use(router)

router.Use(cors.New(cors.Config{
Expand Down

0 comments on commit dcce883

Please sign in to comment.