Skip to content
New issue

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

A bug for double called IncrCounterWithLabels Method in PrometheusSink #61

Open
lockTP opened this issue Aug 30, 2017 · 0 comments
Open

Comments

@lockTP
Copy link

lockTP commented Aug 30, 2017

p.mu.Lock() defer p.mu.Unlock() key, hash := p.flattenKey(parts, labels) **g, ok := p.counters[hash]** if !ok { g = prometheus.NewCounter(prometheus.CounterOpts{ Name: key, Help: key, ConstLabels: prometheusLabels(labels), }) prometheus.MustRegister(g) **p.counters[key] = g** } g.Add(float64(val))

When finding the counter, the method use "hash" as the key to search the counter. However, it put the counter into the map with "key", which make bug in double calling for IncrCounterWithLabels or any other XXXWithLabels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant