From 73bb8717db97a8186920d4762e7be300ee3a40a5 Mon Sep 17 00:00:00 2001 From: Phil Winder Date: Fri, 17 Mar 2017 14:19:17 +0000 Subject: [PATCH] Rename path label to route and add service label --- api/metrics/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/metrics/index.js b/api/metrics/index.js index 7ec7deffb..0b695ccd5 100644 --- a/api/metrics/index.js +++ b/api/metrics/index.js @@ -8,7 +8,7 @@ const metric = { http: { requests: { - duration: new client.Summary('request_duration_seconds', 'request duration in seconds', ['method', 'path', 'status_code']), + duration: new client.Summary('request_duration_seconds', 'request duration in seconds', ['service', 'method', 'route', 'status_code']), } } } @@ -19,11 +19,11 @@ } function observe(method, path, statusCode, start) { - var path = path.toLowerCase(); - if (path !== '/metrics' && path !== '/metrics/') { + var route = path.toLowerCase(); + if (route !== '/metrics' && route !== '/metrics/') { var duration = s(start); var method = method.toLowerCase(); - metric.http.requests.duration.labels(method, path, statusCode).observe(duration); + metric.http.requests.duration.labels('front-end', method, route, statusCode).observe(duration); } };