Skip to content

Commit

Permalink
refactor(instrumentations): add safeguard for unknown values
Browse files Browse the repository at this point in the history
  • Loading branch information
dszakallas committed Jan 16, 2017
1 parent 3eb6ff6 commit ef99b9c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/instrumentations/utils/wrapQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ function wrapQuery (original, args, agent, params) {
reportSend: function () {
var briefcase = agent.storage.get('tracer.briefcase')
var communication = briefcase && briefcase.communication
var severity = briefcase && briefcase.severity

var action = _params.method == null ? 'unknown' : _params.method
var resource = _params.url == null ? 'unknown' : _params.url

var cs = agent.tracer.collector.clientSend({
protocol: _params.protocol,
Expand All @@ -27,10 +29,9 @@ function wrapQuery (original, args, agent, params) {
communication: communication
})

debug('#wrapQuery', format('CS(%s) [%s %s %s %s]',
cs.briefcase.csCtx.communicationId, _params.protocol,
_params.method, _params.url,
_params.host))
debug('#wrapQuery', format('CS(%s) [%s %s %s %s]',
cs.briefcase.csCtx.communicationId, _params.protocol,
action, resource, _params.host))

return cs
},
Expand Down

0 comments on commit ef99b9c

Please sign in to comment.