micro/metrics/reporter.go
Prawn da4159513e
Metrics interface and Prometheus implementation (#1929)
* Metrics interface

* Prometheus implementation

* NoOp implementation

Co-authored-by: chris <chris@Profanity.local>
2020-08-18 08:27:50 +01:00

14 lines
362 B
Go

package metrics
import "time"
// Tags is a map of fields to add to a metric:
type Tags map[string]string
// Reporter is the standard metrics interface:
type Reporter interface {
Count(metricName string, value int64, tags Tags) error
Gauge(metricName string, value float64, tags Tags) error
Timing(metricName string, value time.Duration, tags Tags) error
}