Skip to content
This repository has been archived by the owner on Mar 24, 2022. It is now read-only.

prometheus: Use counter for db queries #276

Merged
merged 1 commit into from May 23, 2018

Conversation

databus23
Copy link
Contributor

@databus23 databus23 commented May 17, 2018

This renames the concourse_db_queries metric to concourse_db_queries_total and changes it to a counter that tracks the total number of db queries since application start.

This is way more accurate and ideomeatic for prometheu's pull model. The previous approach was very error prune and almost certainly very incorrect.

@TimSimmons Any comments?

@TimSimmons
Copy link
Contributor

It's been a while, but I believe I used ConstMetrics (which are generally the more idiomatic method for this type of thing) for a reason.

But now that I look at it again I think that reason might have been that I didn't know they were periodically emitted: https://github.com/concourse/atc/blob/d3cc08277460b8dbd220862d32a56eb7625581ac/metric/periodic.go
So this is probably a perfectly fine way to do things 👍 and will give you a nice counter for database queries over time.

This renames the concourse_db_queries metric to concourse_db_queries_total and changes it to a counter that tracks the total number of db queries since application start.

This is way more accurate and ideomatic for prometheus pull model. The previous approach was very error prune and almost certainly very incorrect.
@vito
Copy link
Contributor

vito commented May 23, 2018

thanks!

@vito vito merged commit febea07 into vmware-archive:master May 23, 2018
@vito vito modified the milestone: v3.14.0 Jun 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants