From 07e23a34ed3566a1789942a5d26b315f35431853 Mon Sep 17 00:00:00 2001 From: Evan Cordell Date: Fri, 30 Sep 2016 13:40:34 -0400 Subject: [PATCH] Fix metrics --- buildman/manager/ephemeral.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/buildman/manager/ephemeral.py b/buildman/manager/ephemeral.py index 3c3ebe033..592af511e 100644 --- a/buildman/manager/ephemeral.py +++ b/buildman/manager/ephemeral.py @@ -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.