Skip to content

Commit

Permalink
[pinpoint-apm#86] introuce trace
Browse files Browse the repository at this point in the history
  • Loading branch information
feelform committed Sep 12, 2023
1 parent e8cd617 commit cdae825
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/instrumentation/module/express.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ module.exports = function (agent, version, express) {
}
}

const spanEventRecorder = trace.traceBlockBegin()
spanEventRecorder.recordServiceType(ServiceTypeCode.express)

let handle
if (origin.length !== 4) {
handle = function (req, res, next) {
Expand All @@ -110,7 +113,6 @@ module.exports = function (agent, version, express) {
return next.apply(this, arguments)
}
}

return origin.apply(this, arguments)
}
} else {
Expand All @@ -123,7 +125,7 @@ module.exports = function (agent, version, express) {
}

for (const prop in origin) {
if (Object.prototype.hasOwnProperty.call(orig, prop)) {
if (Object.prototype.hasOwnProperty.call(origin, prop)) {
handle[prop] = origin[prop]
}
}
Expand Down

0 comments on commit cdae825

Please sign in to comment.