diff --git a/metrics/noop.go b/metrics/noop.go index 8f210b77..ffb4e143 100644 --- a/metrics/noop.go +++ b/metrics/noop.go @@ -16,6 +16,14 @@ func NewReporter(opts ...Option) Reporter { } } +// Init initialize options +func (r *noopReporter) Init(opts ...Option) error { + for _, o := range opts { + o(&r.opts) + } + return nil +} + // Count implements the Reporter interface Count method: func (r *noopReporter) Count(metricName string, value int64, tags Tags) error { return nil diff --git a/metrics/reporter.go b/metrics/reporter.go index 84f998f6..b0e45197 100644 --- a/metrics/reporter.go +++ b/metrics/reporter.go @@ -12,6 +12,7 @@ var ( // Reporter is an interface for collecting and instrumenting metrics type Reporter interface { + Init(...Option) error Count(id string, value int64, tags Tags) error Gauge(id string, value float64, tags Tags) error Timing(id string, value time.Duration, tags Tags) error