@@ -93,8 +93,6 @@ private function __construct(
93
93
$ span ->name = $ this ->operationNameConvention = Convention::defaultOperationName ($ span );
94
94
}
95
95
96
- $ this ->uniqueIdentifier = \spl_object_hash ($ this ); // traceId + spanId is NOT a valid unique identifier, as the traceId can be modified
97
-
98
96
// Set the span links
99
97
if ($ isRemapped ) {
100
98
// At initialization time (now), only set the links if the span was created using the OTel API
@@ -111,7 +109,7 @@ private function __construct(
111
109
$ spanLink ->droppedAttributesCount = 0 ; // Attributes limit aren't supported/meaningful in DD
112
110
113
111
// Save the link
114
- ObjectKVStore::put ($ spanLink , $ this -> uniqueIdentifier , $ link );
112
+ ObjectKVStore::put ($ spanLink , " link " , $ link );
115
113
$ span ->links [] = $ spanLink ;
116
114
}
117
115
}
@@ -453,7 +451,7 @@ private function updateSpanLinks()
453
451
$ otel = [];
454
452
foreach ($ datadogSpanLinks as $ datadogSpanLink ) {
455
453
// Check if the link relationship exists
456
- $ link = ObjectKVStore::get ($ datadogSpanLink , $ this -> uniqueIdentifier );
454
+ $ link = ObjectKVStore::get ($ datadogSpanLink , " link " );
457
455
if ($ link === null ) {
458
456
// Create the link
459
457
$ link = new Link (
@@ -467,12 +465,9 @@ private function updateSpanLinks()
467
465
);
468
466
469
467
// Save the link
470
- ObjectKVStore::put ($ datadogSpanLink , $ this ->uniqueIdentifier , $ link );
471
- $ otel [] = $ link ;
472
- } else {
473
- // Save the link
474
- $ otel [] = $ link ;
468
+ ObjectKVStore::put ($ datadogSpanLink , "link " , $ link );
475
469
}
470
+ $ otel [] = $ link ;
476
471
}
477
472
478
473
// Update the links
0 commit comments