diff --git a/CHANGELOG.md b/CHANGELOG.md index 77c89bb..869534a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [1.1.0](https://github.com/serverless-tencent/tencent-component-monitor/compare/v1.0.6...v1.1.0) (2020-05-28) + + +### Features + +* support no report flag ([982b418](https://github.com/serverless-tencent/tencent-component-monitor/commit/982b4182e513255f0d093c53aaf3136e0576cdd7)) + ## [1.0.6](https://github.com/serverless-tencent/tencent-component-monitor/compare/v1.0.5...v1.0.6) (2020-05-25) diff --git a/package.json b/package.json index e7cb5be..50bb92f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tencent-component-monitor", - "version": "1.0.6", + "version": "1.1.0", "description": "Tencent component monitor", "main": "src/index.js", "scripts": { diff --git a/src/instrumentation/core/http.js b/src/instrumentation/core/http.js index 59c1fa0..dfb3fbd 100644 --- a/src/instrumentation/core/http.js +++ b/src/instrumentation/core/http.js @@ -23,7 +23,7 @@ function wrapEmitWithTransaction(agent, emit) { method: request.method, statusCode } - agent.emit('responseFinish', context, data) + agent.emit('responseFinish', context, data, request.__SLS_NO_REPORT__) } } transaction.end() diff --git a/src/instrumentation/tencent-serverless-http.js b/src/instrumentation/tencent-serverless-http.js index ce8ccbf..7b64ef8 100644 --- a/src/instrumentation/tencent-serverless-http.js +++ b/src/instrumentation/tencent-serverless-http.js @@ -8,8 +8,8 @@ module.exports = function initialize(agent, httpProxy) { transaction.init() const proxy = fn.apply(this, arguments) return new Promise(function(resolve) { - agent.once('responseFinish', function(ctx, data) { - if (ctx) { + agent.once('responseFinish', function(ctx, data, noReport) { + if (ctx && noReport !== true) { report.reportHttp(ctx, data).then( function(/* _data*/) { // const { Response } = _data || {}