feature(app.py): adding queue_metrics to queues
publishing queue metrics for SRE [none]
This commit is contained in:
parent
8755706454
commit
3fd8c8a60d
4 changed files with 9 additions and 5 deletions
|
@ -62,6 +62,10 @@ class MetricQueue(object):
|
|||
'Available items in a queue',
|
||||
labelnames=['queue_name'])
|
||||
|
||||
self.work_queue_available_not_running = prom.create_gauge('work_queue_available_not_running',
|
||||
'Available items that are not yet running',
|
||||
labelnames=['queue_name'])
|
||||
|
||||
self.repository_pull = prom.create_counter('repository_pull', 'Repository Pull Count',
|
||||
labelnames=['namespace', 'repo_name', 'protocol',
|
||||
'status'])
|
||||
|
@ -165,7 +169,6 @@ def _time_after_request(name, metric_queue):
|
|||
return r
|
||||
|
||||
dur = time.time() - start
|
||||
dims = {'endpoint': request.endpoint}
|
||||
|
||||
metric_queue.resp_time.Observe(dur, labelvalues=[request.endpoint])
|
||||
metric_queue.resp_code.Inc(labelvalues=[request.endpoint, r.status_code])
|
||||
|
|
Reference in a new issue