Skip to content

Commit

Permalink
use /debug/metrics as endpoint, seems more proper/elegant
Browse files Browse the repository at this point in the history
  • Loading branch information
Dieterbe committed Nov 30, 2015
1 parent 3a7d7c5 commit 7da7ed5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ import "github.com/rcrowley/go-metrics/stathat"
go stathat.Stathat(metrics.DefaultRegistry, 10e9, "[email protected]")
```

Maintain all metrics along with expvars at `/debug/vars2`:
Maintain all metrics along with expvars at `/debug/metrics`:

This uses the same mechanism as [the official expvar](http://golang.org/pkg/expvar/)
but exposed under `/debug/vars2`, which shows a json representation of all your usual expvars
but exposed under `/debug/metrics`, which shows a json representation of all your usual expvars
as well as all your go-metrics.


Expand Down
4 changes: 2 additions & 2 deletions exp/exp.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Hook go-metrics into expvar
// on any /debug/vars2 request, load all vars from the registry into expvar, and execute regular expvar handler
// on any /debug/metrics request, load all vars from the registry into expvar, and execute regular expvar handler
package exp

import (
Expand Down Expand Up @@ -39,7 +39,7 @@ func Exp(r metrics.Registry) {
// panic: http: multiple registrations for /debug/vars
// http.HandleFunc("/debug/vars", e.expHandler)
// haven't found an elegant way, so just use a different endpoint
http.HandleFunc("/debug/vars2", e.expHandler)
http.HandleFunc("/debug/metrics", e.expHandler)
}

func (exp *exp) getInt(name string) *expvar.Int {
Expand Down

0 comments on commit 7da7ed5

Please sign in to comment.