Skip to content

Commit

Permalink
rollback return of NewRegistry to copy, not pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
voyvodov committed Dec 19, 2023
1 parent 2226378 commit 1922c20
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func ExposeMetrics(ctx context.Context, eventChan <-chan event.SaltEvent, watchC
return
}

eventToMetrics(event, registry)
eventToMetrics(event, &registry)
}
}
}
4 changes: 2 additions & 2 deletions internal/metrics/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -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...)
Expand All @@ -38,7 +38,7 @@ func NewRegistry(config Config) *Registry {
scheduledJobReturnTotalLabels = append([]string{"minion"}, scheduledJobReturnTotalLabels...)
}

return &Registry{
return Registry{
config: config,

observedMinions: 0,
Expand Down

0 comments on commit 1922c20

Please sign in to comment.