Further updates to the Prometheus client code
This commit is contained in:
parent
668a8edc50
commit
713ba3abaf
9 changed files with 165 additions and 127 deletions
|
@ -340,7 +340,8 @@ class EphemeralBuilderManager(BaseManager):
|
|||
|
||||
try:
|
||||
builder_id = yield From(self._executor.start_builder(realm, token, build_uuid))
|
||||
metric_queue.put('EC2BuilderStarted', 1, unit='Count')
|
||||
metric_queue.put_deprecated('EC2BuilderStarted', 1, unit='Count')
|
||||
metric_queue.ephemeral_build_workers.Inc(labelvalues=[builder_id, build_uuid])
|
||||
except:
|
||||
logger.exception('Exception when starting builder for job: %s', build_uuid)
|
||||
raise Return(False, EC2_API_TIMEOUT)
|
||||
|
|
|
@ -152,7 +152,8 @@ class EC2Executor(BuilderExecutor):
|
|||
))
|
||||
except boto.exception.EC2ResponseError as ec2e:
|
||||
logger.exception('Unable to spawn builder instance')
|
||||
metric_queue.put('EC2BuildStartFailure', 1, unit='Count')
|
||||
metric_queue.put_deprecated('EC2BuildStartFailure', 1, unit='Count')
|
||||
metric_queue.ephemeral_build_worker_failure.Inc(labelvalues=[build_uuid])
|
||||
raise ec2e
|
||||
|
||||
if not reservation.instances:
|
||||
|
|
|
@ -18,10 +18,8 @@ from buildman.jobutil.buildjob import BuildJob, BuildJobLoadException
|
|||
from data import database
|
||||
from app import app, metric_queue
|
||||
from app import app
|
||||
from util.prometheus import Counter
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
build_counter = Counter('builds', 'Number of builds', labelnames=['name'])
|
||||
|
||||
WORK_CHECK_TIMEOUT = 10
|
||||
TIMEOUT_PERIOD_MINUTES = 20
|
||||
|
@ -240,5 +238,5 @@ def report_completion_status(status):
|
|||
else:
|
||||
return
|
||||
|
||||
metric_queue.put(status_name, 1, unit='Count')
|
||||
build_counter.Inc(labelvalues=[status_name])
|
||||
metric_queue.put_deprecated(status_name, 1, unit='Count')
|
||||
metric_queue.build_counter.Inc(labelvalues=[status_name])
|
||||
|
|
Reference in a new issue