Closed stevvooe closed 8 years ago
Getting some build errors
github.com/docker/go-metrics
# github.com/docker/go-metrics
./counter.go:43: undefined: sumFloat64
./gauge.go:47: undefined: sumFloat64
./gauge.go:55: undefined: sumFloat64
# github.com/docker/go-metrics
./counter.go:43: undefined: sumFloat64
./gauge.go:47: undefined: sumFloat64
./gauge.go:55: undefined: sumFloat64
@crosbymichael Forgot to check in file. Fixed.
Namespace is refactored into a concrete factory type that allows callers to create labeled and unlabeled metrics. Namespaces can be declared with all metrics with constant labels from the start or can be broken apart using
WithConstLabels
to have different sets of constant labels for child metrics.Metrics requiring labels must now explicitly set the labels before using the actual counter. We use the convention
Metrics
andLabeledMetric
to differentiate these types. Users of the metric must supply label values to theWithValues
function, in order. This interface may be slightly error prone but allows for zero allocation workflows on metric reporting.All metrics now implement
prometheus.Collector
, includingNamespace
, which allows registering metrics individually or as group withNamespace
.Signed-off-by: Stephen J Day stephen.day@docker.com
cc @crosbymichael