diff --git a/app/init.php b/app/init.php index 82fba586a8..c51edf9899 100644 --- a/app/init.php +++ b/app/init.php @@ -223,8 +223,8 @@ const API_KEY_DYNAMIC = 'dynamic'; // Usage metrics const METRIC_TEAMS = 'teams'; const METRIC_USERS = 'users'; -const METRIC_MESSAGES = 'messages'; -const METRIC_MESSAGES_COUNTRY_CODE = '{countryCode}.messages'; +const METRIC_AUTH_METHOD_PHONE = 'auth.method.phone'; +const METRIC_AUTH_METHOD_PHONE_COUNTRY_CODE = METRIC_AUTH_METHOD_PHONE . '.{countryCode}'; const METRIC_SESSIONS = 'sessions'; const METRIC_DATABASES = 'databases'; const METRIC_COLLECTIONS = 'collections'; diff --git a/src/Appwrite/Platform/Workers/Messaging.php b/src/Appwrite/Platform/Workers/Messaging.php index 0f0d298e3b..271bbfedf1 100644 --- a/src/Appwrite/Platform/Workers/Messaging.php +++ b/src/Appwrite/Platform/Workers/Messaging.php @@ -452,10 +452,10 @@ class Messaging extends Action $countryCode = $adapter->getCountryCode($message['to'][0] ?? ''); if (!empty($countryCode)) { $queueForUsage - ->addMetric(str_replace('{countryCode}', $countryCode, METRIC_MESSAGES_COUNTRY_CODE), 1); + ->addMetric(str_replace('{countryCode}', $countryCode, METRIC_AUTH_METHOD_PHONE_COUNTRY_CODE), 1); } $queueForUsage - ->addMetric(METRIC_MESSAGES, 1) + ->addMetric(METRIC_AUTH_METHOD_PHONE, 1) ->setProject($project) ->trigger(); } catch (\Throwable $th) {