From 00acfbdf86603af180400fb253f66768ebdffca2 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Tue, 10 May 2016 09:41:39 +0100 Subject: [PATCH] fix tagname for graphite --- services/clsi/app/coffee/CompileManager.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/clsi/app/coffee/CompileManager.coffee b/services/clsi/app/coffee/CompileManager.coffee index dc6c8337b0..dcd1a98b78 100644 --- a/services/clsi/app/coffee/CompileManager.coffee +++ b/services/clsi/app/coffee/CompileManager.coffee @@ -32,8 +32,8 @@ module.exports = CompileManager = injectDraftModeIfRequired (error) -> return callback(error) if error? timer = new Metrics.Timer("run-compile") - # find the image tag to log it as a metric - tag = request.imageName?.match(/:(.*)/)?[1] or "default" + # find the image tag to log it as a metric, e.g. 2015.1 (convert . to - for graphite) + tag = request.imageName?.match(/:(.*)/)?[1]?.replace(/\./g,'-') or "default" tag = "other" if project_id?.match(/^[0-9a-f]{24}$/) # exclude smoke test Metrics.inc("compiles") Metrics.inc("compiles-with-image.#{tag}")