From 982b4182e513255f0d093c53aaf3136e0576cdd7 Mon Sep 17 00:00:00 2001 From: yugasun Date: Thu, 28 May 2020 16:43:46 +0800 Subject: [PATCH 1/2] feat: support no report flag --- src/instrumentation/core/http.js | 2 +- src/instrumentation/tencent-serverless-http.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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 || {} From 9f725c68b98fcf93970598f7f12a3e6049c8f85c Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Thu, 28 May 2020 08:49:18 +0000 Subject: [PATCH 2/2] chore(release): version 1.1.0 # [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)) --- CHANGELOG.md | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) 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": {