Skip to content

pg_up metric returns last calculated value without explicit resetting… #291

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

Merged

Conversation

d-ulyanov
Copy link
Contributor

@d-ulyanov d-ulyanov commented Jul 26, 2019

If exporter is scraped by multiple Prometheuses (as we do) - Collect() could be called concurrently. In result in some cases one of Prometheuses could get pg_up = 0, because it was explicitly set to zero on first Collect call.

Copy link
Contributor Author

@d-ulyanov d-ulyanov left a comment

Choose a reason for hiding this comment

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

okay, everything is fixed

@coveralls
Copy link

Coverage Status

Coverage increased (+0.9%) to 59.85% when pulling de68444 on d-ulyanov:concurrency-improvements into 5f3a711 on wrouesnel:master.

@coveralls
Copy link

coveralls commented Jul 26, 2019

Coverage Status

Coverage increased (+0.9%) to 59.091% when pulling 9aeff83 on d-ulyanov:concurrency-improvements into 1ab8d2b on wrouesnel:master.

@d-ulyanov
Copy link
Contributor Author

@wrouesnel pls take a look for this issue

@wrouesnel wrouesnel merged commit 238f5c0 into prometheus-community:master Aug 12, 2019
ritbl referenced this pull request in heniek/postgres_exporter Mar 19, 2023
…ting (percona#291)

If exporter is scraped by multiple Prometheuses (as we do) - Collect() could be called concurrently. In result in some cases one of Prometheuses could get pg_up = 0, because it was explicitly set to zero on first Collect call.
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

Successfully merging this pull request may close these issues.

4 participants