Registry /
observability / contrib-instrumentation-github-com-gin-gonic-gin-otelgin
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
otelgin
✓ go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin
Adds OpenTelemetry middleware to a Gin router.
package main
import (
"github.com/gin-gonic/gin"
"go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin"
)
func main() {
r := gin.Default()
r.Use(otelgin.Middleware("my-service"))
r.GET("/ping", func(c *gin.Context) {
c.String(200, "pong")
})
r.Run()
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
0.69.0latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.