From 345d8f2db57862b362d6a8ff66c2d2a14fa10a75 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Wed, 4 Feb 2026 10:15:36 +0530 Subject: [PATCH] fix: use individual span attributes for country codes Replace stringified JSON countryCodes attribute with individual countryCode_{code} attributes to improve LogQL query compatibility. --- src/Appwrite/Platform/Workers/Messaging.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Appwrite/Platform/Workers/Messaging.php b/src/Appwrite/Platform/Workers/Messaging.php index e23e55f1fb..3a2f96715c 100644 --- a/src/Appwrite/Platform/Workers/Messaging.php +++ b/src/Appwrite/Platform/Workers/Messaging.php @@ -201,8 +201,8 @@ class Messaging extends Action $countryCodes[$countryCode] = ($countryCodes[$countryCode] ?? 0) + 1; } } - if (!empty($countryCodes)) { - Span::add('countryCodes', \json_encode($countryCodes)); + foreach ($countryCodes as $code => $count) { + Span::add('countryCode_' . $code, $count); } } @@ -441,8 +441,8 @@ class Messaging extends Action $countryCodes[$countryCode] = ($countryCodes[$countryCode] ?? 0) + 1; } } - if (!empty($countryCodes)) { - Span::add('countryCodes', \json_encode($countryCodes)); + foreach ($countryCodes as $code => $count) { + Span::add('countryCode_' . $code, $count); } if ($this->adapter === null) {