kubo/core/corehttp/prometheus.go
Lars Gierth ed8d3ae388 api: add /metrics endpoint for prometheus
License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
2015-06-29 23:15:15 +02:00

17 lines
361 B
Go

package corehttp
import (
"net/http"
prom "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus"
"github.com/ipfs/go-ipfs/core"
)
func PrometheusOption(path string) ServeOption {
return func(n *core.IpfsNode, mux *http.ServeMux) (*http.ServeMux, error) {
mux.Handle(path, prom.Handler())
return mux, nil
}
}