Skip to content

Commit 4bdc524

Browse files
committed
Don't set the '_dd1.sr.eausr' on parsing failure
1 parent b2420d2 commit 4bdc524

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Diff for: tests/OpenTelemetry/Integration/API/TracerTest.php

+9-3
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ public function providerAnalyticsEvent()
345345
["false", 0],
346346
["False", 0],
347347
["FALSE", 0],
348-
["something-else", 0],
348+
["something-else", null],
349349
[True, 1],
350350
[False, 0],
351351
['t', 1],
@@ -354,6 +354,8 @@ public function providerAnalyticsEvent()
354354
['F', 0],
355355
['1', 1],
356356
['0', 0],
357+
['fAlse', null],
358+
['trUe', null]
357359
];
358360
}
359361

@@ -372,8 +374,12 @@ public function testReservedAttributesOverridesAnalyticsEvent($analyticsEventVal
372374
});
373375

374376
$span = $traces[0][0];
375-
$actualMetricValue = $span['metrics']['_dd1.sr.eausr'];
376-
$this->assertEquals($expectedMetricValue, $actualMetricValue);
377+
if ($expectedMetricValue !== null) {
378+
$actualMetricValue = $span['metrics']['_dd1.sr.eausr'];
379+
$this->assertEquals($expectedMetricValue, $actualMetricValue);
380+
} else {
381+
$this->assertArrayNotHasKey('_dd1.sr.eausr', $span['metrics']);
382+
}
377383
}
378384

379385
public function testSpanErrorStatus()

0 commit comments

Comments
 (0)