mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Add Prometheus statistics and an example to showcase them using Grafana
This commit is contained in:
9
api/server/prometheus_metrics.go
Normal file
9
api/server/prometheus_metrics.go
Normal file
@@ -0,0 +1,9 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func (s *Server) handlePrometheusMetrics(c *gin.Context) {
|
||||
s.Agent.PromHandler().ServeHTTP(c.Writer, c.Request)
|
||||
}
|
||||
@@ -280,6 +280,7 @@ func (s *Server) bindHandlers(ctx context.Context) {
|
||||
engine.GET("/", handlePing)
|
||||
engine.GET("/version", handleVersion)
|
||||
engine.GET("/stats", s.handleStats)
|
||||
engine.GET("/metrics", s.handlePrometheusMetrics)
|
||||
|
||||
{
|
||||
v1 := engine.Group("/v1")
|
||||
|
||||
Reference in New Issue
Block a user