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

Fixes negative gauge in Promtail. #3971

Merged
merged 2 commits into from
Jul 8, 2021

Conversation

cyriltovena
Copy link
Contributor

Fixes #3281

Signed-off-by: Cyril Tovena cyril.tovena@gmail.com

Fixes grafana#3281

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
@@ -201,7 +201,7 @@ func (m *metricStage) recordCounter(name string, counter *metric.Counters, label
counter.With(labels).Inc()
case metric.CounterAdd:
f, err := getFloat(v)
if err != nil || f < 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's weird; wonder why this was set. This one is for a counter - can we do a negative add in a counter? I'd assume so.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷

Copy link
Contributor

@sandeepsukhani sandeepsukhani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
@cyriltovena cyriltovena merged commit 337aed0 into grafana:main Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Negative numbers not extracted by promtail to a Gauge metric
3 participants