diff --git a/buildman/manager/ephemeral.py b/buildman/manager/ephemeral.py index 0d1c482e2..931f2e373 100644 --- a/buildman/manager/ephemeral.py +++ b/buildman/manager/ephemeral.py @@ -10,6 +10,7 @@ from trollius import From, coroutine, Return, async from concurrent.futures import ThreadPoolExecutor from urllib3.exceptions import ReadTimeoutError, ProtocolError +from app import metric_queue from buildman.manager.basemanager import BaseManager from buildman.manager.executor import PopenExecutor, EC2Executor from buildman.component.buildcomponent import BuildComponent @@ -335,6 +336,7 @@ class EphemeralBuilderManager(BaseManager): try: builder_id = yield From(self._executor.start_builder(realm, token, build_uuid)) + metric_queue.put('EC2BuilderStarted', 1, unit='Count') except: logger.exception('Exception when starting builder for job: %s', build_uuid) raise Return(False, EC2_API_TIMEOUT) diff --git a/data/queue.py b/data/queue.py index b787d22be..9b03123d0 100644 --- a/data/queue.py +++ b/data/queue.py @@ -127,7 +127,10 @@ class WorkQueue(object): params['available_after'] = available_date with self._transaction_factory(db): - return str(QueueItem.create(**params).id) + r = str(QueueItem.create(**params).id) + if self._metric_queue: + self._metric_queue.put('Added', 1, dimensions={'queue': self._queue_name}) + return r def get(self, processing_time=300): """