View Source Appwrite.Services.Health (appwrite v0.2.1)
The Health service is designed to allow you to both validate and monitor that your Appwrite instance and all of its internal components are up and responsive.
Use the Health service to perform system health checks, verify queue sizes, monitor storage availability, and check database, cache, and antivirus statuses.
Note: This service requires an API key with server-side privileges. It is not intended for use in client-side code.
Summary
Functions
Check the Appwrite HTTP server is up and responsive.
Check the Appwrite antivirus server is up and the connection is successful.
Check the Appwrite in-memory cache servers are up and responsive.
Get the SSL certificate for a domain.
Check the Appwrite database servers are up and responsive.
Get the number of failed jobs in a given queue.
Check the Appwrite pub-sub servers are up and responsive.
Check the Appwrite in-memory queue messaging servers are up and responsive.
Get the number of audit logs waiting to be processed in the internal queue.
Get the number of builds waiting to be processed in the internal queue.
Get the number of SSL certificates waiting to be renewed in the internal queue.
Get the number of database changes waiting to be processed in the internal queue.
Get the number of background destructive changes waiting to be processed in the internal queue.
Get the number of function executions waiting to be processed in the internal queue.
Get the number of logs waiting to be processed in the internal queue.
Get the number of mails waiting to be processed in the internal queue.
Get the number of messages waiting to be processed in the internal queue.
Get the number of migrations waiting to be processed in the internal queue.
Get the number of usage stats operations waiting to be processed in the internal queue.
Get the number of usage dump operations waiting to be processed in the internal queue.
Get the number of webhooks waiting to be processed in the internal queue.
Check the Appwrite storage device is up and responsive.
Check the Appwrite local storage device is up and responsive.
Check the Appwrite server time is synced with a remote NTP server.
Functions
@spec get() :: {:ok, Appwrite.Types.HealthStatus.t()} | {:error, Appwrite.Exceptions.AppwriteException.t()}
Check the Appwrite HTTP server is up and responsive.
Returns
{:ok, HealthStatus.t()}on success.{:error, AppwriteException.t()}on failure.
@spec get_antivirus() :: {:ok, Appwrite.Types.HealthAntivirus.t()} | {:error, Appwrite.Exceptions.AppwriteException.t()}
Check the Appwrite antivirus server is up and the connection is successful.
Requires an active antivirus server.
Returns
{:ok, HealthAntivirus.t()}on success.{:error, AppwriteException.t()}on failure.
@spec get_cache() :: {:ok, Appwrite.Types.HealthStatus.t()} | {:error, Appwrite.Exceptions.AppwriteException.t()}
Check the Appwrite in-memory cache servers are up and responsive.
Returns
{:ok, HealthStatus.t()}on success.{:error, AppwriteException.t()}on failure.
@spec get_certificate(String.t() | nil) :: {:ok, Appwrite.Types.HealthCertificate.t()} | {:error, Appwrite.Exceptions.AppwriteException.t()}
Get the SSL certificate for a domain.
Parameters
domain(String.t() | nil): The domain name to check, ornilto check the default.
Returns
{:ok, HealthCertificate.t()}on success.{:error, AppwriteException.t()}on failure.
@spec get_db() :: {:ok, Appwrite.Types.HealthStatus.t()} | {:error, Appwrite.Exceptions.AppwriteException.t()}
Check the Appwrite database servers are up and responsive.
Returns
{:ok, HealthStatus.t()}on success.{:error, AppwriteException.t()}on failure.
@spec get_failed_jobs(String.t(), non_neg_integer() | nil) :: {:ok, Appwrite.Types.HealthQueue.t()} | {:error, Appwrite.Exceptions.AppwriteException.t()}
Get the number of failed jobs in a given queue.
Parameters
name(String.t()): The name of the queue. Valid values include"v1-database","v1-deletes","v1-audits","v1-mails","v1-functions","v1-usage","v1-usage-dump","v1-webhooks","v1-certificates","v1-builds","v1-messaging","v1-migrations","v1-statsitems".threshold(non_neg_integer() | nil): Queue size threshold. Defaults to5000.
Returns
{:ok, HealthQueue.t()}on success.{:error, AppwriteException.t()}on failure.
@spec get_pub_sub() :: {:ok, Appwrite.Types.HealthStatus.t()} | {:error, Appwrite.Exceptions.AppwriteException.t()}
Check the Appwrite pub-sub servers are up and responsive.
Returns
{:ok, HealthStatus.t()}on success.{:error, AppwriteException.t()}on failure.
@spec get_queue() :: {:ok, Appwrite.Types.HealthStatus.t()} | {:error, Appwrite.Exceptions.AppwriteException.t()}
Check the Appwrite in-memory queue messaging servers are up and responsive.
Returns
{:ok, HealthStatus.t()}on success.{:error, AppwriteException.t()}on failure.
@spec get_queue_audits(non_neg_integer() | nil) :: {:ok, Appwrite.Types.HealthQueue.t()} | {:error, Appwrite.Exceptions.AppwriteException.t()}
Get the number of audit logs waiting to be processed in the internal queue.
Parameters
threshold(non_neg_integer() | nil): Queue size threshold. Defaults to5000.
Returns
{:ok, HealthQueue.t()}on success.{:error, AppwriteException.t()}on failure.
@spec get_queue_builds(non_neg_integer() | nil) :: {:ok, Appwrite.Types.HealthQueue.t()} | {:error, Appwrite.Exceptions.AppwriteException.t()}
Get the number of builds waiting to be processed in the internal queue.
Parameters
threshold(non_neg_integer() | nil): Queue size threshold. Returns a server error when the queue size reaches or exceeds this value. Defaults to5000.
Returns
{:ok, HealthQueue.t()}on success.{:error, AppwriteException.t()}on failure.
@spec get_queue_certificates(non_neg_integer() | nil) :: {:ok, Appwrite.Types.HealthQueue.t()} | {:error, Appwrite.Exceptions.AppwriteException.t()}
Get the number of SSL certificates waiting to be renewed in the internal queue.
Parameters
threshold(non_neg_integer() | nil): Queue size threshold. Defaults to5000.
Returns
{:ok, HealthQueue.t()}on success.{:error, AppwriteException.t()}on failure.
@spec get_queue_databases(String.t() | nil, non_neg_integer() | nil) :: {:ok, Appwrite.Types.HealthQueue.t()} | {:error, Appwrite.Exceptions.AppwriteException.t()}
Get the number of database changes waiting to be processed in the internal queue.
Parameters
name(String.t() | nil): The name of the specific database queue.threshold(non_neg_integer() | nil): Queue size threshold. Defaults to5000.
Returns
{:ok, HealthQueue.t()}on success.{:error, AppwriteException.t()}on failure.
@spec get_queue_deletes(non_neg_integer() | nil) :: {:ok, Appwrite.Types.HealthQueue.t()} | {:error, Appwrite.Exceptions.AppwriteException.t()}
Get the number of background destructive changes waiting to be processed in the internal queue.
Parameters
threshold(non_neg_integer() | nil): Queue size threshold. Defaults to5000.
Returns
{:ok, HealthQueue.t()}on success.{:error, AppwriteException.t()}on failure.
@spec get_queue_functions(non_neg_integer() | nil) :: {:ok, Appwrite.Types.HealthQueue.t()} | {:error, Appwrite.Exceptions.AppwriteException.t()}
Get the number of function executions waiting to be processed in the internal queue.
Parameters
threshold(non_neg_integer() | nil): Queue size threshold. Defaults to5000.
Returns
{:ok, HealthQueue.t()}on success.{:error, AppwriteException.t()}on failure.
@spec get_queue_logs(non_neg_integer() | nil) :: {:ok, Appwrite.Types.HealthQueue.t()} | {:error, Appwrite.Exceptions.AppwriteException.t()}
Get the number of logs waiting to be processed in the internal queue.
Parameters
threshold(non_neg_integer() | nil): Queue size threshold. Defaults to5000.
Returns
{:ok, HealthQueue.t()}on success.{:error, AppwriteException.t()}on failure.
@spec get_queue_mails(non_neg_integer() | nil) :: {:ok, Appwrite.Types.HealthQueue.t()} | {:error, Appwrite.Exceptions.AppwriteException.t()}
Get the number of mails waiting to be processed in the internal queue.
Parameters
threshold(non_neg_integer() | nil): Queue size threshold. Defaults to5000.
Returns
{:ok, HealthQueue.t()}on success.{:error, AppwriteException.t()}on failure.
@spec get_queue_messaging(non_neg_integer() | nil) :: {:ok, Appwrite.Types.HealthQueue.t()} | {:error, Appwrite.Exceptions.AppwriteException.t()}
Get the number of messages waiting to be processed in the internal queue.
Parameters
threshold(non_neg_integer() | nil): Queue size threshold. Defaults to5000.
Returns
{:ok, HealthQueue.t()}on success.{:error, AppwriteException.t()}on failure.
@spec get_queue_migrations(non_neg_integer() | nil) :: {:ok, Appwrite.Types.HealthQueue.t()} | {:error, Appwrite.Exceptions.AppwriteException.t()}
Get the number of migrations waiting to be processed in the internal queue.
Parameters
threshold(non_neg_integer() | nil): Queue size threshold. Defaults to5000.
Returns
{:ok, HealthQueue.t()}on success.{:error, AppwriteException.t()}on failure.
@spec get_queue_usage(non_neg_integer() | nil) :: {:ok, Appwrite.Types.HealthQueue.t()} | {:error, Appwrite.Exceptions.AppwriteException.t()}
Get the number of usage stats operations waiting to be processed in the internal queue.
Parameters
threshold(non_neg_integer() | nil): Queue size threshold. Defaults to5000.
Returns
{:ok, HealthQueue.t()}on success.{:error, AppwriteException.t()}on failure.
@spec get_queue_usage_dump(non_neg_integer() | nil) :: {:ok, Appwrite.Types.HealthQueue.t()} | {:error, Appwrite.Exceptions.AppwriteException.t()}
Get the number of usage dump operations waiting to be processed in the internal queue.
Parameters
threshold(non_neg_integer() | nil): Queue size threshold. Defaults to5000.
Returns
{:ok, HealthQueue.t()}on success.{:error, AppwriteException.t()}on failure.
@spec get_queue_webhooks(non_neg_integer() | nil) :: {:ok, Appwrite.Types.HealthQueue.t()} | {:error, Appwrite.Exceptions.AppwriteException.t()}
Get the number of webhooks waiting to be processed in the internal queue.
Parameters
threshold(non_neg_integer() | nil): Queue size threshold. Defaults to5000.
Returns
{:ok, HealthQueue.t()}on success.{:error, AppwriteException.t()}on failure.
@spec get_storage() :: {:ok, Appwrite.Types.HealthStatus.t()} | {:error, Appwrite.Exceptions.AppwriteException.t()}
Check the Appwrite storage device is up and responsive.
Returns
{:ok, HealthStatus.t()}on success.{:error, AppwriteException.t()}on failure.
@spec get_storage_local() :: {:ok, Appwrite.Types.HealthStatus.t()} | {:error, Appwrite.Exceptions.AppwriteException.t()}
Check the Appwrite local storage device is up and responsive.
Returns
{:ok, HealthStatus.t()}on success.{:error, AppwriteException.t()}on failure.
@spec get_time() :: {:ok, Appwrite.Types.HealthTime.t()} | {:error, Appwrite.Exceptions.AppwriteException.t()}
Check the Appwrite server time is synced with a remote NTP server.
Appwrite uses NTP to handle leap seconds smoothly. A large drift may indicate a configuration issue on the Appwrite host.
Returns
{:ok, HealthTime.t()}on success.{:error, AppwriteException.t()}on failure.