Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit 7da7ed5

Browse files
committed
use /debug/metrics as endpoint, seems more proper/elegant
1 parent 3a7d7c5 commit 7da7ed5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ import "github.com/rcrowley/go-metrics/stathat"
9090
go stathat.Stathat(metrics.DefaultRegistry, 10e9, "[email protected]")
9191
```
9292

93-
Maintain all metrics along with expvars at `/debug/vars2`:
93+
Maintain all metrics along with expvars at `/debug/metrics`:
9494

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

9999

exp/exp.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Hook go-metrics into expvar
2-
// on any /debug/vars2 request, load all vars from the registry into expvar, and execute regular expvar handler
2+
// on any /debug/metrics request, load all vars from the registry into expvar, and execute regular expvar handler
33
package exp
44

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

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

0 commit comments

Comments
 (0)