Skip to content

Commit 2bc64eb

Browse files
authored
Merge pull request #118 from dnephin/expose-default-metrics
Expose the global default metrics
2 parents 3901aee + 67afe45 commit 2bc64eb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

start.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"sync/atomic"
77
"time"
88

9-
"github.com/hashicorp/go-immutable-radix"
9+
iradix "github.com/hashicorp/go-immutable-radix"
1010
)
1111

1212
// Config is used to configure metrics settings
@@ -48,6 +48,11 @@ func init() {
4848
globalMetrics.Store(&Metrics{sink: &BlackholeSink{}})
4949
}
5050

51+
// Default returns the shared global metrics instance.
52+
func Default() *Metrics {
53+
return globalMetrics.Load().(*Metrics)
54+
}
55+
5156
// DefaultConfig provides a sane default configuration
5257
func DefaultConfig(serviceName string) *Config {
5358
c := &Config{

0 commit comments

Comments
 (0)