-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
api: add /metrics endpoint for prometheus
License: MIT Signed-off-by: Lars Gierth <[email protected]>
- Loading branch information
Lars Gierth
committed
Jun 29, 2015
1 parent
2d6b787
commit ed8d3ae
Showing
2 changed files
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |