mirror of
https://github.com/openfaas/faas.git
synced 2025-06-09 08:46:48 +00:00
20 lines
453 B
Go
20 lines
453 B
Go
package metrics
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/prometheus/client_golang/prometheus"
|
|
)
|
|
|
|
// MetricOptions to be used by web handlers
|
|
type MetricOptions struct {
|
|
GatewayRequestsTotal prometheus.Counter
|
|
GatewayServerlessServedTotal prometheus.Counter
|
|
GatewayFunctions prometheus.Histogram
|
|
}
|
|
|
|
// PrometheusHandler Bootstraps prometheus for metrics collection
|
|
func PrometheusHandler() http.Handler {
|
|
return prometheus.Handler()
|
|
}
|