@@ -10,7 +10,7 @@ const serverUrlHttp = '[CONFIGURE_URL_HERE]';
1010const serverUrlHttps = '[CONFIGURE_URL_HERE]' ;
1111const storeGracePeriodInMs = 1000 ;
1212// required if authentication is turned on
13- const apiKeyWithUserLevelPermissions = null ;
13+ const apiKeyWithUserLevelPermissions = null ;
1414
1515describe ( 'SeqLogger' , ( ) => {
1616
@@ -47,21 +47,23 @@ function testEmitAndVerifyStored(url, apiKey, done) {
4747 logger . emit ( event ) ;
4848
4949 setTimeout ( ( ) => {
50- verifyMarkerStored ( event . properties . testMarker , url , apiKey , done ) ;
50+ verifyMarkerStored ( event . properties . testMarker , event . traceId , event . spanId , url , apiKey , done ) ;
5151 } , storeGracePeriodInMs ) ;
5252}
5353
5454function makeTestEvent ( ) {
5555 return {
5656 level : 'Error' ,
5757 timestamp : new Date ( ) ,
58+ traceId : '6112be4ab9f113c499dbf4817e503a69' ,
59+ spanId : '2f2b39a596fc76cd' ,
5860 messageTemplate : 'Event produced by integration test' ,
5961 exception : 'Some error at some file on some line' ,
6062 properties : { testMarker : uuid . v4 ( ) }
6163 } ;
6264}
6365
64- function verifyMarkerStored ( testMarker , url , apiKey , callback ) {
66+ function verifyMarkerStored ( testMarker , traceId , spanId , url , apiKey , callback ) {
6567
6668 request . get ( url + '/api/events' )
6769 . query ( { count : 1 , filter : 'Equal(testMarker, @"' + testMarker + '")' } )
@@ -71,11 +73,14 @@ function verifyMarkerStored(testMarker, url, apiKey, callback) {
7173 callback ( err ) ;
7274 return ;
7375 }
74-
76+
7577 if ( res . body instanceof Array
7678 && res . body . length === 1
7779 && res . body [ 0 ] . Properties
78- && res . body [ 0 ] . Properties . some ( item => item . Name === "testMarker" && item . Value === testMarker ) ) {
80+ && res . body [ 0 ] . Properties . some ( item => item . Name === "testMarker" && item . Value === testMarker )
81+ && res . body [ 0 ] . TraceId === traceId
82+ && res . body [ 0 ] . SpanId === spanId
83+ ) {
7984 callback ( ) ;
8085 return ;
8186 }
0 commit comments