Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
use gin.Context.FullPath method instead
  • Loading branch information
Sniper91 authored Sep 30, 2021
1 parent 2199a42 commit 4e3f59c
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,7 @@ func main() {
p := ginprometheus.NewPrometheus("gin")

p.ReqCntURLLabelMappingFn = func(c *gin.Context) string {
url := c.Request.URL.Path
for _, p := range c.Params {
if p.Key == "name" {
url = strings.Replace(url, p.Value, ":name", 1)
break
}
}
return url
return c.FullPath()
}

p.Use(r)
Expand Down

0 comments on commit 4e3f59c

Please sign in to comment.