Skip to content

Commit 982b418

Browse files
committed
feat: support no report flag
1 parent 09e4cef commit 982b418

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/instrumentation/core/http.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function wrapEmitWithTransaction(agent, emit) {
2323
method: request.method,
2424
statusCode
2525
}
26-
agent.emit('responseFinish', context, data)
26+
agent.emit('responseFinish', context, data, request.__SLS_NO_REPORT__)
2727
}
2828
}
2929
transaction.end()

src/instrumentation/tencent-serverless-http.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ module.exports = function initialize(agent, httpProxy) {
88
transaction.init()
99
const proxy = fn.apply(this, arguments)
1010
return new Promise(function(resolve) {
11-
agent.once('responseFinish', function(ctx, data) {
12-
if (ctx) {
11+
agent.once('responseFinish', function(ctx, data, noReport) {
12+
if (ctx && noReport !== true) {
1313
report.reportHttp(ctx, data).then(
1414
function(/* _data*/) {
1515
// const { Response } = _data || {}

0 commit comments

Comments
 (0)