Skip to content

KVConfig. MetricsRegisterer looks an anti-pattern #24

@pracucci

Description

@pracucci

The KVConfig defined in kv/memberlist/memberlist_client.go includes MetricsRegisterer prometheus.Registerer:

// Where to put custom metrics. Metrics are not registered, if this is nil.
MetricsRegisterer prometheus.Registerer `yaml:"-"`
MetricsNamespace string `yaml:"-"`

This looks an anti-pattern to me. The registerer is typically specified in the NewXXX() function. In this case, I'm wondering if we could remove the registered from there and take it in input in the NewKV() function.

Any reason why not doing it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions