Fix metrics

This commit is contained in:
Evan Cordell 2016-09-30 13:40:34 -04:00
parent 68c5384473
commit 07e23a34ed

View file

@ -544,9 +544,9 @@ class EphemeralBuilderManager(BaseManager):
realm_data = yield From(self._etcd_client.read(self._etcd_realm_key(build_component.builder_realm)))
parsed_realm_data = json.loads(realm_data.value)
start_time = parsed_realm_data['start_time']
metric_queue.builder_time_to_build(time.time() - start_time, labelvalues=[parsed_realm_data.get('executor_name', 'unknown')])
except (KeyError, etcd.EtcdKeyError):
logger.warning('Could not read realm key %s', build_component.builder_realm)
metric_queue.builder_time_to_build.Observe(time.time() - start_time, labelvalues=[parsed_realm_data.get('executor_name', 'unknown')])
except Exception:
logger.exception("Could not write start metric for realm key %s", build_component.builder_realm)
try:
# Clean up the bookkeeping for allowing any manager to take the job.