📅 You're Invited: Meet the Socket team at RSAC (April 28 – May 1).RSVP
Socket
Sign inDemoInstall
Socket

github.com/carousell/gin-prometheus-middleware

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/carousell/gin-prometheus-middleware

v1.5.10
Source
Go
Version published
Created
Source

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")
}

FAQs

Package last updated on 04 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts