Skip to content

Commit 0273a06

Browse files
committed
don't trace the post to the otel backend
1 parent f56c8da commit 0273a06

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ All notable changes to this project will be documented in this file.
55

66
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
77

8+
## [0.2.7] 2023-09-03
89

10+
- don't enrich span for outgoing trace http post
11+
912
## [0.2.6] 2023-09-03
1013

1114
- fix build

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@baselime/lambda-node-opentelemetry",
3-
"version": "0.2.6",
3+
"version": "0.2.7",
44
"description": "OpenTelemetry auto tracer for Node.JS based AWS Lambda functions",
55
"keywords": [
66
"nodejs",

src/lambda-wrapper.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,10 @@ const instrumentations: Instrumentation[] = [
7272
new HttpInstrumentation({
7373
requestHook: (span, request) => {
7474

75-
if (request instanceof ClientRequest) {
75+
if (request instanceof ClientRequest && request.host !== 'sandbox' && request.host !== 'console.baselime.cc') {
7676
const requestBodyChunks: string[] = [];
7777
const oldWrite = request.write.bind(request);
7878
request.write = (data: any) => {
79-
console.log('request body chunk:', decodeURIComponent(data.toString()));
8079
requestBodyChunks.push(decodeURIComponent(data.toString()));
8180
return oldWrite(data);
8281
};
@@ -85,7 +84,6 @@ const instrumentations: Instrumentation[] = [
8584
if (data) {
8685
requestBodyChunks.push(decodeURIComponent(data.toString()));
8786
}
88-
console.log('request body:', requestBodyChunks.join(), request);
8987
const headers = request.getHeaders();
9088

9189
const body: string = requestBodyChunks.join();

0 commit comments

Comments
 (0)