mirror of
https://github.com/prometheus/statsd_exporter.git
synced 2024-11-29 10:41:00 +00:00
Use an interface for Registry so we may have multiple implementations
Signed-off-by: bakins <brian@akins.org>
This commit is contained in:
parent
420dc651d8
commit
4acb05aa89
1 changed files with 9 additions and 1 deletions
|
@ -31,9 +31,17 @@ const (
|
||||||
regErrF = "Failed to update metric"
|
regErrF = "Failed to update metric"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Registry interface {
|
||||||
|
GetCounter(metricName string, labels prometheus.Labels, help string, mapping *mapper.MetricMapping, metricsCount *prometheus.GaugeVec) (prometheus.Counter, error)
|
||||||
|
GetGauge(metricName string, labels prometheus.Labels, help string, mapping *mapper.MetricMapping, metricsCount *prometheus.GaugeVec) (prometheus.Gauge, error)
|
||||||
|
GetHistogram(metricName string, labels prometheus.Labels, help string, mapping *mapper.MetricMapping, metricsCount *prometheus.GaugeVec) (prometheus.Observer, error)
|
||||||
|
GetSummary(metricName string, labels prometheus.Labels, help string, mapping *mapper.MetricMapping, metricsCount *prometheus.GaugeVec) (prometheus.Observer, error)
|
||||||
|
RemoveStaleMetrics()
|
||||||
|
}
|
||||||
|
|
||||||
type Exporter struct {
|
type Exporter struct {
|
||||||
Mapper *mapper.MetricMapper
|
Mapper *mapper.MetricMapper
|
||||||
Registry *registry.Registry
|
Registry Registry
|
||||||
Logger log.Logger
|
Logger log.Logger
|
||||||
EventsActions *prometheus.CounterVec
|
EventsActions *prometheus.CounterVec
|
||||||
EventsUnmapped prometheus.Counter
|
EventsUnmapped prometheus.Counter
|
||||||
|
|
Loading…
Reference in a new issue