Skip to content

carousell/md-gin-prometheus-middleware

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gin-prometheus-middleware

Go Gin middleware for Prometheus

Export metrics for request duration request_duration and request count request_count

Example

import (
    gpmiddleware "github.com/carousell/gin-prometheus-middleware"
    "github.com/gin-gonic/gin"
)

func main(){
    r := gin.New()
    
    p := gpmiddleware.NewPrometheus("gin")
    p.Use(r)
    
    r.GET("/", func(c *gin.Context) {
        c.JSON(200, "Hello world! visit /metrics for metrics")
})

    r.Run(":37321")
}

About

Go Gin Prometheus middleware

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%