File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " datadog-lambda-js" ,
3
- "version" : " 2.16 .0" ,
3
+ "version" : " 2.17 .0" ,
4
4
"description" : " Lambda client library that supports hybrid tracing in node js" ,
5
5
"main" : " dist/index.js" ,
6
6
"types" : " dist/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ export class TraceListener {
50
50
logDebug ( "Didn't patch console output with trace context" ) ;
51
51
}
52
52
53
+ // If the DD tracer is initialized then it's doing http patching so we don't again here
53
54
if ( this . config . autoPatchHTTP && ! tracerInitialized ) {
54
55
logDebug ( "Patching HTTP libraries" ) ;
55
56
patchHttp ( this . contextService ) ;
@@ -63,7 +64,9 @@ export class TraceListener {
63
64
}
64
65
65
66
public async onCompleteInvocation ( ) {
66
- if ( this . config . autoPatchHTTP ) {
67
+ // If the DD tracer is initialized it manages patching of the http lib on its own
68
+ const tracerInitialized = this . tracerWrapper . isTracerAvailable ;
69
+ if ( this . config . autoPatchHTTP && ! tracerInitialized ) {
67
70
logDebug ( "Unpatching HTTP libraries" ) ;
68
71
unpatchHttp ( ) ;
69
72
}
You can’t perform that action at this time.
0 commit comments