File tree 3 files changed +8
-6
lines changed
3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " datadog-lambda-js" ,
3
- "version" : " 3.26 .0" ,
3
+ "version" : " 3.27 .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 @@ -150,8 +150,7 @@ describe("TraceListener", () => {
150
150
function_arn : "arn:aws:lambda:us-east-1:123456789101:function:my-lambda" ,
151
151
function_version : "$LATEST" ,
152
152
request_id : "1234" ,
153
- resource_names : "my-lambda" ,
154
- "_dd.parent_source" : "xray" ,
153
+ resource_names : "my-lambda"
155
154
} ,
156
155
type : "serverless" ,
157
156
} ,
Original file line number Diff line number Diff line change @@ -90,16 +90,19 @@ export class TraceListener {
90
90
if ( this . context ) {
91
91
logDebug ( "Applying lambda context to datadog traces" ) ;
92
92
const functionArn = ( this . context . invokedFunctionArn ?? "" ) . toLowerCase ( ) ;
93
- const tk = functionArn . split ( ":" )
93
+ const tk = functionArn . split ( ":" ) ;
94
94
options . tags = {
95
95
cold_start : didFunctionColdStart ( ) ,
96
96
function_arn : tk . length > 7 ? tk . slice ( 0 , 7 ) . join ( ":" ) : functionArn ,
97
97
function_version : tk . length > 7 ? tk [ 7 ] : "$LATEST" ,
98
98
request_id : this . context . awsRequestId ,
99
99
resource_names : this . context . functionName ,
100
100
} ;
101
- if ( this . contextService . traceSource !== Source . DDTrace ) {
102
- options . tags [ '_dd.parent_source' ] = this . contextService . traceSource ;
101
+ if (
102
+ ( this . contextService . traceSource === Source . Xray && this . config . mergeDatadogXrayTraces ) ||
103
+ this . contextService . traceSource === Source . Event
104
+ ) {
105
+ options . tags [ "_dd.parent_source" ] = this . contextService . traceSource ;
103
106
}
104
107
}
105
108
if ( this . stepFunctionContext ) {
You can’t perform that action at this time.
0 commit comments