We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IIUC these lines https://github.com/armon/go-metrics/blob/master/prometheus/prometheus.go#L129-L134 will create a collision for the Collector type if we attempt to register more than one PrometheusSink.
Collector
PrometheusSink
One repro scenario is described here hashicorp/consul#11273 .
Also, I have a test can repro this and will comment below
.Describe()
The text was updated successfully, but these errors were encountered:
Test to repro:
err
err = duplicate metrics collector registration attempted
func TestNewPrometheusSink(t *testing.T) { gaugeDef := GaugeDefinition{ Name: []string{"my", "test", "gauge"}, Help: "A gauge for testing? How helpful!", } // PrometheusSink config w/ definitions for each metric type cfg := PrometheusOpts{ Expiration: 5 * time.Second, GaugeDefinitions: append([]GaugeDefinition{}, gaugeDef), SummaryDefinitions: append([]SummaryDefinition{}), CounterDefinitions: append([]CounterDefinition{}), } sink1, err := NewPrometheusSinkFrom(cfg) reg := prometheus.DefaultRegisterer if err != nil { t.Fatalf("err = %v, want nil", err) } gaugeDef2 := GaugeDefinition{ Name: []string{"my2", "test", "gauge"}, Help: "A gauge for testing? How helpful!", } cfg2 := PrometheusOpts{ Expiration: 15 * time.Second, GaugeDefinitions: append([]GaugeDefinition{}, gaugeDef2), SummaryDefinitions: append([]SummaryDefinition{}), CounterDefinitions: append([]CounterDefinition{}), } sink2, err := NewPrometheusSinkFrom(cfg2) // errors out ... }
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Overview
IIUC these lines https://github.com/armon/go-metrics/blob/master/prometheus/prometheus.go#L129-L134 will create a collision for the
Collector
type if we attempt to register more than onePrometheusSink
.Repro
One repro scenario is described here hashicorp/consul#11273 .
Also, I have a test can repro this and will comment below
Proposed Fixes
.Describe()
needs to be reworkedThe text was updated successfully, but these errors were encountered: