Skip to content

Commit e242760

Browse files
committed
fix attempt 2
1 parent dcc0a9c commit e242760

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

tests/ext/telemetry/process_tags.phpt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,16 @@ for ($i = 0; $i < 300; ++$i) {
3333
foreach (file(__DIR__ . '/process-tags-telemetry.out') as $l) {
3434
if ($l) {
3535
$json = json_decode($l, true);
36-
var_dump($json["application"]["process_tags"]);
37-
break 2;
36+
if (!is_array($json)) {
37+
continue;
38+
}
39+
$batch = (isset($json["request_type"]) && $json["request_type"] == "message-batch") ? $json["payload"] : [$json];
40+
foreach ($batch as $entry) {
41+
if (isset($entry["application"]["process_tags"])) {
42+
var_dump($entry["application"]["process_tags"]);
43+
break 3;
44+
}
45+
}
3846
}
3947
}
4048
}

0 commit comments

Comments
 (0)