diff --git a/CHANGELOG.md b/CHANGELOG.md index b73fc9b..37750fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [1.0.3](https://github.com/serverless-tencent/tencent-component-monitor/compare/v1.0.2...v1.0.3) (2020-05-13) + + +### Bug Fixes + +* 获取context方式修改 ([d9e4dc6](https://github.com/serverless-tencent/tencent-component-monitor/commit/d9e4dc6ddccc3c8b84c0ce0152efb4bf3799a236)) + ## [1.0.2](https://github.com/serverless-tencent/tencent-component-monitor/compare/v1.0.1...v1.0.2) (2020-05-09) diff --git a/package.json b/package.json index 12c22fe..9dd79ed 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tencent-component-monitor", - "version": "1.0.2", + "version": "1.0.3", "description": "Tencent component monitor", "main": "src/index.js", "scripts": { diff --git a/src/instrumentation/core/http.js b/src/instrumentation/core/http.js index 4043bf0..59c1fa0 100644 --- a/src/instrumentation/core/http.js +++ b/src/instrumentation/core/http.js @@ -15,7 +15,7 @@ function wrapEmitWithTransaction(agent, emit) { const statusCode = String(response.statusCode) const path = transaction.path || request.path if (/^\d+$/.test(statusCode)) { - const context = request.headers['x-apigateway-context'] + const context = request.__SLS_CONTEXT__ const latency = Date.now() - transaction.start const data = { latency,