1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-04-15 01:16:22 +02:00

fix: gh-720 Use express path templates for prometheus metrics (#724)

This commit is contained in:
checketts 2021-02-15 05:04:56 -07:00 committed by GitHub
parent 4e63512ee1
commit f49b5084eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,15 +1,13 @@
'use strict';
const url = require('url');
const responseTime = require('response-time');
const { REQUEST_TIME } = require('../events');
module.exports = function(config) {
return responseTime((req, res, time) => {
const { statusCode } = res;
const pathname = req.route
? url.parse(req.originalUrl).pathname
: '(hidden)';
const pathname = req.route ? req.baseUrl + req.route.path : '(hidden)';
const timingInfo = {
path: pathname,