From a51ae360d7ff41c4c750f9cdcec614f961077e96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20Szak=C3=A1llas?= Date: Fri, 25 Nov 2016 11:28:59 +0100 Subject: [PATCH] fix(mysql): add default values --- lib/instrumentations/mysql.js | 4 ++-- lib/instrumentations/mysql.spec.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/instrumentations/mysql.js b/lib/instrumentations/mysql.js index 60e28c8..4f0a252 100644 --- a/lib/instrumentations/mysql.js +++ b/lib/instrumentations/mysql.js @@ -24,9 +24,9 @@ function composeAgentData (config, args) { } return { protocol: consts.PROTOCOLS.MYSQL, - url: connectionURI || undefined, + url: connectionURI || 'unknown', host: config.host || 'unknown', - method: utils.tryParseSql(args[0] || '') + method: utils.tryParseSql(args[0]) || 'unknown' } } diff --git a/lib/instrumentations/mysql.spec.js b/lib/instrumentations/mysql.spec.js index d3ea6ea..582ac7d 100644 --- a/lib/instrumentations/mysql.spec.js +++ b/lib/instrumentations/mysql.spec.js @@ -83,7 +83,7 @@ describe('The mysql wrapper', function () { host: 'unknown', method: 'SELECT', protocol: 'mysql', - url: undefined + url: 'unknown' }) done() }) @@ -129,7 +129,7 @@ describe('The mysql wrapper', function () { host: 'unknown', method: 'SELECT', protocol: 'mysql', - url: undefined + url: 'unknown' }) done() })