lib/metrics: Add SetupMetricFields to enable remote metrics tryjob
We need this mechanism to test adding common metric fields to all
metric call in build. This change only creates a temp file for now.
BUG=chromium:867658
TEST=run_tests
Change-Id: I8312dddd707e56dbe19e2fa9e2a59a491491d1fa
Reviewed-on: https://chromium-review.googlesource.com/1222154
Commit-Ready: Dhanya Ganesh <dhanyaganesh@chromium.org>
Tested-by: Dhanya Ganesh <dhanyaganesh@chromium.org>
Reviewed-by: Lann Martin <lannm@chromium.org>
diff --git a/scripts/cbuildbot_launch.py b/scripts/cbuildbot_launch.py
index 597ba27..0cef443 100644
--- a/scripts/cbuildbot_launch.py
+++ b/scripts/cbuildbot_launch.py
@@ -434,6 +434,12 @@
'tryjob': options.remote_trybot,
}
+ #TODO: Move error handling to lib.metrics
+ try:
+ metrics.SetupMetricFields(fields=metrics_fields)
+ except Exception:
+ logging.error('SetupMetricFields Exception:', exc_info=True)
+
# Does the entire build pass or fail.
with metrics.Presence(METRIC_ACTIVE, metrics_fields), \
metrics.SuccessCounter(METRIC_COMPLETED, metrics_fields) as s_fields: