Send the status code with the HTTP request size metric

This commit is contained in:
Eric Mc Sween 2020-03-12 06:24:46 -04:00
parent 4a92be80ea
commit 62e82d7469

View file

@ -17,7 +17,7 @@ module.exports.monitor = (logger) ->
routePath = req.route.path.toString().replace(/\//g, '_').replace(/\:/g, '').slice(1) routePath = req.route.path.toString().replace(/\//g, '_').replace(/\:/g, '').slice(1)
Metrics.timing("http_request", responseTimeMs, null, {method:req.method, status_code: res.statusCode, path:routePath}) Metrics.timing("http_request", responseTimeMs, null, {method:req.method, status_code: res.statusCode, path:routePath})
if requestSize if requestSize
Metrics.summary("http_request_size_bytes", requestSize, {method:req.method, path:routePath}) Metrics.summary("http_request_size_bytes", requestSize, {method:req.method, status_code: res.statusCode, path:routePath})
remoteIp = req.ip || req.socket?.socket?.remoteAddress || req.socket?.remoteAddress remoteIp = req.ip || req.socket?.socket?.remoteAddress || req.socket?.remoteAddress
reqUrl = req.originalUrl || req.url reqUrl = req.originalUrl || req.url
referrer = req.headers['referer'] || req.headers['referrer'] referrer = req.headers['referer'] || req.headers['referrer']