mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-19 16:31:01 +00:00
15 lines
319 B
Go
15 lines
319 B
Go
|
package metrics
|
||
|
|
||
|
import (
|
||
|
"github.com/gin-gonic/gin"
|
||
|
|
||
|
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||
|
)
|
||
|
|
||
|
// PromHandler will pass the call from /api/metrics/prometheus to prometheus
|
||
|
func PromHandler() gin.HandlerFunc {
|
||
|
return func(c *gin.Context) {
|
||
|
promhttp.Handler().ServeHTTP(c.Writer, c.Request)
|
||
|
}
|
||
|
}
|