Skip to content

Commit

Permalink
Merge pull request ipfs/kubo#1422 from lgierth/metrics
Browse files Browse the repository at this point in the history
Expose metrics via Prometheus

This commit was moved from ipfs/kubo@74a331d
  • Loading branch information
jbenet committed Jun 30, 2015
2 parents 7040b5c + 5ce3d10 commit 650267e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions gateway/core/corehttp/prometheus.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
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
}
}

0 comments on commit 650267e

Please sign in to comment.