From 1a02e5e87fa7e8b8fc9745d81e23bdf3e355b19b Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Thu, 2 Jul 2026 18:13:44 +0530 Subject: [PATCH] Remove logs queue health endpoint --- .../Health/Http/Health/Queue/Logs/Get.php | 60 ------------------- .../Platform/Modules/Health/Services/Http.php | 2 - tests/e2e/Services/GraphQL/Base.php | 7 --- tests/e2e/Services/GraphQL/HealthTest.php | 21 ------- tests/e2e/Services/Health/LogsQueueTest.php | 19 ------ 5 files changed, 109 deletions(-) delete mode 100644 src/Appwrite/Platform/Modules/Health/Http/Health/Queue/Logs/Get.php delete mode 100644 tests/e2e/Services/Health/LogsQueueTest.php diff --git a/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/Logs/Get.php b/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/Logs/Get.php deleted file mode 100644 index 0a655662de..0000000000 --- a/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/Logs/Get.php +++ /dev/null @@ -1,60 +0,0 @@ -setHttpMethod(Base::HTTP_REQUEST_METHOD_GET) - ->setHttpPath('/v1/health/queue/logs') - ->desc('Get logs queue') - ->groups(['api', 'health']) - ->label('scope', 'health.read') - ->label('sdk', new Method( - namespace: 'health', - group: 'queue', - name: 'getQueueLogs', - description: '/docs/references/health/get-queue-logs.md', - auth: [AuthType::ADMIN, AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_HEALTH_QUEUE, - ) - ], - contentType: ContentType::JSON - )) - ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->inject('publisherForAudits') - ->inject('response') - ->callback($this->action(...)); - } - - public function action(int|string $threshold, Audit $publisherForAudits, Response $response): void - { - $threshold = (int) $threshold; - - $size = $publisherForAudits->getSize(); - - $this->assertQueueThreshold($size, $threshold); - - $response->dynamic(new Document(['size' => $size]), Response::MODEL_HEALTH_QUEUE); - } -} diff --git a/src/Appwrite/Platform/Modules/Health/Services/Http.php b/src/Appwrite/Platform/Modules/Health/Services/Http.php index a6acbcb4d4..9f933c7f13 100644 --- a/src/Appwrite/Platform/Modules/Health/Services/Http.php +++ b/src/Appwrite/Platform/Modules/Health/Services/Http.php @@ -15,7 +15,6 @@ use Appwrite\Platform\Modules\Health\Http\Health\Queue\Databases\Get as GetQueue use Appwrite\Platform\Modules\Health\Http\Health\Queue\Deletes\Get as GetQueueDeletes; use Appwrite\Platform\Modules\Health\Http\Health\Queue\Failed\Get as GetFailedJobs; use Appwrite\Platform\Modules\Health\Http\Health\Queue\Functions\Get as GetQueueFunctions; -use Appwrite\Platform\Modules\Health\Http\Health\Queue\Logs\Get as GetQueueLogs; use Appwrite\Platform\Modules\Health\Http\Health\Queue\Mails\Get as GetQueueMails; use Appwrite\Platform\Modules\Health\Http\Health\Queue\Messaging\Get as GetQueueMessaging; use Appwrite\Platform\Modules\Health\Http\Health\Queue\Migrations\Get as GetQueueMigrations; @@ -49,7 +48,6 @@ class Http extends Service $this->addAction(GetQueueAudits::getName(), new GetQueueAudits()); $this->addAction(GetQueueWebhooks::getName(), new GetQueueWebhooks()); - $this->addAction(GetQueueLogs::getName(), new GetQueueLogs()); $this->addAction(GetQueueCertificates::getName(), new GetQueueCertificates()); $this->addAction(GetQueueBuilds::getName(), new GetQueueBuilds()); $this->addAction(GetQueueDatabases::getName(), new GetQueueDatabases()); diff --git a/tests/e2e/Services/GraphQL/Base.php b/tests/e2e/Services/GraphQL/Base.php index 7a05071c75..973549c73b 100644 --- a/tests/e2e/Services/GraphQL/Base.php +++ b/tests/e2e/Services/GraphQL/Base.php @@ -264,7 +264,6 @@ trait Base public const string GET_CACHE_HEALTH = 'get_cache_health'; public const string GET_TIME_HEALTH = 'get_time_health'; public const string GET_WEBHOOKS_QUEUE_HEALTH = 'get_webhooks_queue_health'; - public const string GET_LOGS_QUEUE_HEALTH = 'get_logs_queue_health'; public const string GET_CERTIFICATES_QUEUE_HEALTH = 'get_certificates_queue_health'; public const string GET_FUNCTION_QUEUE_HEALTH = 'get_functions_queue_health'; public const string GET_LOCAL_STORAGE_HEALTH = 'get_local_storage_health'; @@ -2451,12 +2450,6 @@ trait Base size } }'; - case self::GET_LOGS_QUEUE_HEALTH: - return 'query getLogsQueueHealth { - healthGetQueueLogs { - size - } - }'; case self::GET_CERTIFICATES_QUEUE_HEALTH: return 'query getCertificatesQueueHealth { healthGetQueueCertificates { diff --git a/tests/e2e/Services/GraphQL/HealthTest.php b/tests/e2e/Services/GraphQL/HealthTest.php index 8b00bc42ef..5cb1fa34a1 100644 --- a/tests/e2e/Services/GraphQL/HealthTest.php +++ b/tests/e2e/Services/GraphQL/HealthTest.php @@ -124,27 +124,6 @@ final class HealthTest extends Scope return $webhooksQueueHealth; } - public function testGetLogsQueueHealth(): array - { - $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::GET_LOGS_QUEUE_HEALTH); - $graphQLPayload = [ - 'query' => $query, - ]; - - $logsQueueHealth = $this->client->call(Client::METHOD_POST, '/graphql', \array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $projectId, - ], $this->getHeaders()), $graphQLPayload); - - $this->assertIsArray($logsQueueHealth['body']['data']); - $this->assertArrayNotHasKey('errors', $logsQueueHealth['body']); - $logsQueueHealth = $logsQueueHealth['body']['data']['healthGetQueueLogs']; - $this->assertIsArray($logsQueueHealth); - - return $logsQueueHealth; - } - public function testGetCertificatesQueueHealth(): array { $projectId = $this->getProject()['$id']; diff --git a/tests/e2e/Services/Health/LogsQueueTest.php b/tests/e2e/Services/Health/LogsQueueTest.php deleted file mode 100644 index 2f5be1aa69..0000000000 --- a/tests/e2e/Services/Health/LogsQueueTest.php +++ /dev/null @@ -1,19 +0,0 @@ -callGet('/health/queue/logs'); - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertIsInt($response['body']['size']); - $this->assertLessThan(100, $response['body']['size']); - - $failure = $this->callGet('/health/queue/logs', ['threshold' => '0']); - $this->assertEquals(503, $failure['headers']['status-code']); - } -}