Skip to content

Commit a51ae36

Browse files
committed
fix(mysql): add default values
1 parent d8e38db commit a51ae36

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

lib/instrumentations/mysql.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ function composeAgentData (config, args) {
2424
}
2525
return {
2626
protocol: consts.PROTOCOLS.MYSQL,
27-
url: connectionURI || undefined,
27+
url: connectionURI || 'unknown',
2828
host: config.host || 'unknown',
29-
method: utils.tryParseSql(args[0] || '')
29+
method: utils.tryParseSql(args[0]) || 'unknown'
3030
}
3131
}
3232

lib/instrumentations/mysql.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ describe('The mysql wrapper', function () {
8383
host: 'unknown',
8484
method: 'SELECT',
8585
protocol: 'mysql',
86-
url: undefined
86+
url: 'unknown'
8787
})
8888
done()
8989
})
@@ -129,7 +129,7 @@ describe('The mysql wrapper', function () {
129129
host: 'unknown',
130130
method: 'SELECT',
131131
protocol: 'mysql',
132-
url: undefined
132+
url: 'unknown'
133133
})
134134
done()
135135
})

0 commit comments

Comments
 (0)