Skip to content
This repository has been archived by the owner on Dec 5, 2023. It is now read-only.

Commit

Permalink
Merge pull request #82 from microservices-demo/monitoring/label-rename
Browse files Browse the repository at this point in the history
Rename path label to route and add service label
  • Loading branch information
nustiueudinastea committed Mar 17, 2017
2 parents 30f0673 + 73bb871 commit fe7f982
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions api/metrics/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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']),
}
}
}
Expand All @@ -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);
}
};

Expand Down

0 comments on commit fe7f982

Please sign in to comment.