Merge pull request #12772 from appwrite/fix/remove-logs-queue-health-endpoint

Remove logs queue health endpoint
This commit is contained in:
Chirag Aggarwal authored and GitHub committed 2026-07-03 14:24:06 +05:30
commit 81fa1f7bd2
7 files changed
+1 -111

No files matched your search

-1
View File
@@ -1 +0,0 @@
Get the number of logs that are waiting to be processed in the Appwrite internal queue server.
@@ -1,60 +0,0 @@
<?php
namespace Appwrite\Platform\Modules\Health\Http\Health\Queue\Logs;
use Appwrite\Event\Publisher\Audit;
use Appwrite\Platform\Modules\Health\Http\Health\Queue\Base;
use Appwrite\SDK\AuthType;
use Appwrite\SDK\ContentType;
use Appwrite\SDK\Method;
use Appwrite\SDK\Response as SDKResponse;
use Appwrite\Utopia\Response;
use Utopia\Database\Document;
use Utopia\Validator\Integer;
class Get extends Base
{
public static function getName(): string
{
return 'getQueueLogs';
}
public function __construct()
{
$this
->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);
}
}
@@ -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());
-7
View File
@@ -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 {
-21
View File
@@ -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'];
@@ -1,19 +0,0 @@
<?php
declare(strict_types=1);
namespace Tests\E2E\Services\Health;
final class LogsQueueTest extends HealthBase
{
public function testLogsQueue(): void
{
$response = $this->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']);
}
}
+1 -1
View File
@@ -1 +1 @@
{"swagger":"2.0","info":{"version":"0.8.0","title":"Appwrite","description":"Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)","termsOfService":"https:\/\/appwrite.io\/policy\/terms","contact":{"name":"Appwrite Team","url":"https:\/\/appwrite.io\/support","email":"team@appwrite.io"},"license":{"name":"BSD-3-Clause","url":"https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE"}},"host":"appwrite.io","basePath":"\/v1","schemes":["https"],"consumes":["application\/json","multipart\/form-data"],"produces":["application\/json"],"securityDefinitions":{"Project":{"type":"apiKey","name":"X-Appwrite-Project","description":"Your project ID","in":"header","x-appwrite":{"demo":"5df5acd0d48c2"}},"Key":{"type":"apiKey","name":"X-Appwrite-Key","description":"Your secret API key","in":"header","x-appwrite":{"demo":"919c2d18fb5d4...a2ae413da83346ad2"}},"JWT":{"type":"apiKey","name":"X-Appwrite-JWT","description":"Your secret JSON Web Token","in":"header","x-appwrite":{"demo":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."}},"Locale":{"type":"apiKey","name":"X-Appwrite-Locale","description":"","in":"header","x-appwrite":{"demo":"en"}},"Mode":{"type":"apiKey","name":"X-Appwrite-Mode","description":"","in":"header","x-appwrite":{"demo":""}}},"paths":{"\/account":{"get":{"summary":"Get Account","operationId":"accountGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user data as JSON object.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"get","weight":44,"cookies":false,"type":"","demo":"account\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}]},"post":{"summary":"Create Account","operationId":"accountCreate","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [\/account\/verfication](\/docs\/client\/account#accountCreateVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](\/docs\/client\/account#accountCreateSession).","responses":{"201":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"create","weight":36,"cookies":false,"type":"","demo":"account\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":["client"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password. Must be between 6 to 32 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["email","password"]}}]},"delete":{"summary":"Delete Account","operationId":"accountDelete","consumes":["application\/json"],"produces":[],"tags":["account"],"description":"Delete a currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. This is done to avoid deleted accounts being overtaken by new users with the same email address. Any user-related resources like documents or storage files should be deleted separately.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":52,"cookies":false,"type":"","demo":"account\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}]}},"\/account\/email":{"patch":{"summary":"Update Account Email","operationId":"accountUpdateEmail","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Update currently logged in user account email address. After changing user address, user confirmation status is being reset and a new confirmaLine truncated
{"swagger":"2.0","info":{"version":"0.8.0","title":"Appwrite","description":"Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)","termsOfService":"https://appwrite.io/policy/terms","contact":{"name":"Appwrite Team","url":"https://appwrite.io/support","email":"team@appwrite.io"},"license":{"name":"BSD-3-Clause","url":"https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE"}},"host":"appwrite.io","basePath":"/v1","schemes":["https"],"consumes":["application/json","multipart/form-data"],"produces":["application/json"],"securityDefinitions":{"Project":{"type":"apiKey","name":"X-Appwrite-Project","description":"Your project ID","in":"header","x-appwrite":{"demo":"5df5acd0d48c2"}},"Key":{"type":"apiKey","name":"X-Appwrite-Key","description":"Your secret API key","in":"header","x-appwrite":{"demo":"919c2d18fb5d4...a2ae413da83346ad2"}},"JWT":{"type":"apiKey","name":"X-Appwrite-JWT","description":"Your secret JSON Web Token","in":"header","x-appwrite":{"demo":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."}},"Locale":{"type":"apiKey","name":"X-Appwrite-Locale","description":"","in":"header","x-appwrite":{"demo":"en"}},"Mode":{"type":"apiKey","name":"X-Appwrite-Mode","description":"","in":"header","x-appwrite":{"demo":""}}},"paths":{"/account":{"get":{"summary":"Get Account","operationId":"accountGet","consumes":["application/json"],"produces":["application/json"],"tags":["account"],"description":"Get currently logged in user data as JSON object.","responses":{"200":{"description":"User","schema":{"$ref":"#/definitions/user"}}},"x-appwrite":{"method":"get","weight":44,"cookies":false,"type":"","demo":"account/get.md","edit":"https://github.com/appwrite/appwrite/edit/master/docs/references/account/get.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}]},"post":{"summary":"Create Account","operationId":"accountCreate","consumes":["application/json"],"produces":["application/json"],"tags":["account"],"description":"Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [/account/verfication](/docs/client/account#accountCreateVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](/docs/client/account#accountCreateSession).","responses":{"201":{"description":"User","schema":{"$ref":"#/definitions/user"}}},"x-appwrite":{"method":"create","weight":36,"cookies":false,"type":"","demo":"account/create.md","edit":"https://github.com/appwrite/appwrite/edit/master/docs/references/account/create.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":["client"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password. Must be between 6 to 32 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["email","password"]}}]},"delete":{"summary":"Delete Account","operationId":"accountDelete","consumes":["application/json"],"produces":[],"tags":["account"],"description":"Delete a currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. This is done to avoid deleted accounts being overtaken by new users with the same email address. Any user-related resources like documents or storage files should be deleted separately.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":52,"cookies":false,"type":"","demo":"account/delete.md","edit":"https://github.com/appwrite/appwrite/edit/master/docs/references/account/delete.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}]}},"/account/email":{"patch":{"summary":"Update Account Email","operationId":"accountUpdateEmail","consumes":["application/json"],"produces":["application/json"],"tags":["account"],"description":"Update currently logged in user account email address. After changing user address, user confirmation status is being reset and a new confirmation mail is sent. For security measures, user password is required to completLine truncated