diff options
Diffstat (limited to 'lib/promise_request.js')
-rw-r--r-- | lib/promise_request.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/promise_request.js b/lib/promise_request.js index 68e8c2f..c34227d 100644 --- a/lib/promise_request.js +++ b/lib/promise_request.js @@ -113,16 +113,18 @@ exports.doRequest = function(mainReq, options, body, targetEntity) { } opInfo.respCode = resp.statusCode || 500; + const metrics_text = "res: " + result.body + + ((reqBody && " req: " + ((typeof(reqBody) !== 'string' && typeof(reqBody)) || reqBody)) || ""); if (resp.statusCode > 199 && resp.statusCode < 300) { // HTTP status code indicates success - resolve the promise opInfo.complete = true; - logger.metrics(mainReq, opInfo, result.body); + logger.metrics(mainReq, opInfo, metrics_text); resolve(result); } else { // Reject the promise opInfo.complete = false; - logger.metrics(mainReq, opInfo, result.body); + logger.metrics(mainReq, opInfo, metrics_text); reject(result); } |