diff --git a/internal/metrics/metrics.go b/internal/metrics/metrics.go index eb97579..a2c1c90 100644 --- a/internal/metrics/metrics.go +++ b/internal/metrics/metrics.go @@ -80,7 +80,7 @@ func ExposeMetrics(ctx context.Context, eventChan <-chan event.SaltEvent, watchC return } - eventToMetrics(event, registry) + eventToMetrics(event, ®istry) } } } diff --git a/internal/metrics/registry.go b/internal/metrics/registry.go index 62ea25f..6ab7dd6 100644 --- a/internal/metrics/registry.go +++ b/internal/metrics/registry.go @@ -27,7 +27,7 @@ type Registry struct { minionsTotal *prometheus.GaugeVec } -func NewRegistry(config Config) *Registry { +func NewRegistry(config Config) Registry { functionResponsesTotalLabels := []string{"function", "state", "success"} if config.SaltFunctionResponsesTotal.AddMinionLabel { functionResponsesTotalLabels = append([]string{"minion"}, functionResponsesTotalLabels...) @@ -38,7 +38,7 @@ func NewRegistry(config Config) *Registry { scheduledJobReturnTotalLabels = append([]string{"minion"}, scheduledJobReturnTotalLabels...) } - return &Registry{ + return Registry{ config: config, observedMinions: 0,