@@ -30,7 +30,7 @@ import {
30
30
ReadableSpan ,
31
31
} from '@opentelemetry/sdk-trace-base' ;
32
32
import { NodeTracerProvider } from '@opentelemetry/sdk-trace-node' ;
33
- import { APIGatewayProxyEvent , Context , SQSEvent } from 'aws-lambda' ;
33
+ import { Context } from 'aws-lambda' ;
34
34
import * as assert from 'assert' ;
35
35
import {
36
36
ATTR_URL_FULL ,
@@ -833,7 +833,7 @@ describe('lambda handler', () => {
833
833
initializeHandler ( 'lambda-test/sync.sqshandler' ) ;
834
834
const producerTraceId = '1df415edd0ad7f83e573f6504381dcec' ;
835
835
const producerSpanId = '83b7424a259945cb' ;
836
- const event = {
836
+ const sqsEvent = {
837
837
Records : [
838
838
{
839
839
messageAttributes : {
@@ -849,11 +849,14 @@ describe('lambda handler', () => {
849
849
] ,
850
850
} ;
851
851
852
- await lambdaRequire ( 'lambda-test/sync' ) . sqshandler ( event , ctx , ( ) => { } ) ;
852
+ await lambdaRequire ( 'lambda-test/sync' ) . sqshandler (
853
+ sqsEvent ,
854
+ ctx ,
855
+ ( ) => { }
856
+ ) ;
853
857
const spans = memoryExporter . getFinishedSpans ( ) ;
854
858
855
859
assert . strictEqual ( spans . length , 2 ) ;
856
-
857
860
assert . equal (
858
861
spans [ 0 ] . parentSpanContext ?. traceId ,
859
862
spans [ 1 ] . spanContext ( ) . traceId
@@ -862,7 +865,6 @@ describe('lambda handler', () => {
862
865
spans [ 0 ] . parentSpanContext ?. spanId ,
863
866
spans [ 1 ] . spanContext ( ) . spanId
864
867
) ;
865
-
866
868
assert . equal ( spans [ 0 ] . links [ 0 ] ?. context . traceId , producerTraceId ) ;
867
869
assert . equal ( spans [ 0 ] . links [ 0 ] . context . spanId , producerSpanId ) ;
868
870
} ) ;
@@ -873,7 +875,7 @@ describe('lambda handler', () => {
873
875
initializeHandler ( 'lambda-test/async.sqshandler' ) ;
874
876
const producerTraceId = '1df415edd0ad7f83e573f6504381dcec' ;
875
877
const producerSpanId = '83b7424a259945cb' ;
876
- const event = {
878
+ const sqsEvent = {
877
879
Records : [
878
880
{
879
881
messageAttributes : {
@@ -889,7 +891,7 @@ describe('lambda handler', () => {
889
891
] ,
890
892
} ;
891
893
892
- await lambdaRequire ( 'lambda-test/async' ) . sqshandler ( event , ctx ) ;
894
+ await lambdaRequire ( 'lambda-test/async' ) . sqshandler ( sqsEvent , ctx ) ;
893
895
const spans = memoryExporter . getFinishedSpans ( ) ;
894
896
895
897
assert . strictEqual ( spans . length , 2 ) ;
0 commit comments