This repository has been archived by the owner. It is now read-only.

prometheus: Use counter for db queries #276

Merged
merged 1 commit into from May 23, 2018

Conversation

Projects
None yet
3 participants
@databus23
Contributor

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

This comment has been minimized.

Contributor

TimSimmons commented May 17, 2018

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.

prometheus: Use counter for db queries
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.

@databus23 databus23 force-pushed the databus23:prometheus-db-metrics branch from ce48045 to 2020eb9 May 17, 2018

@vito vito added the enhancement label May 23, 2018

@vito

This comment has been minimized.

Member

vito commented May 23, 2018

thanks!

@vito vito merged commit febea07 into concourse:master May 23, 2018

2 checks passed

ci/pivotal-cla Thank you for signing the Contributor License Agreement!
Details
concourse-ci/status Concourse CI build success
Details

@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.