From 4428253efe04faf9c16298a80f30ec9d3a63e75a Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Wed, 10 Apr 2024 15:24:03 -0500 Subject: [PATCH] docs: move health_check.rst to admin_server.rst --- docs/references/admin_server.rst | 41 ++++++++++++++++++++++++++++++++ docs/references/health_check.rst | 24 ------------------- 2 files changed, 41 insertions(+), 24 deletions(-) create mode 100644 docs/references/admin_server.rst delete mode 100644 docs/references/health_check.rst diff --git a/docs/references/admin_server.rst b/docs/references/admin_server.rst new file mode 100644 index 000000000..425d31072 --- /dev/null +++ b/docs/references/admin_server.rst @@ -0,0 +1,41 @@ +.. _admin_server: + +Admin Server +############ + +PostgREST provides an admin server that can be enabled by setting :ref:`admin-server-port` to the port number of your preference. + +.. _health_check: + +Health Check +============ + +You can enable a health check to verify if PostgREST is available for client requests. Also to check the status of its internal state. + +Two endpoints ``live`` and ``ready`` will then be available. + +.. important:: + + If you have a machine with multiple network interfaces and multiple PostgREST instances in the same port, you need to specify a unique :ref:`hostname ` + in the configuration of each PostgREST instance for the health check to work correctly. Don't use the special values(``!4``, ``*``, etc) in this case because the health check + could report a false positive. + +Live +---- + +The ``live`` endpoint verifies if PostgREST is running on its configured port. A request will return ``200 OK`` if PostgREST is alive or ``503`` otherwise. + +For instance, to verify if PostgREST is running while the ``admin-server-port`` is set to ``3001``: + +.. code-block:: bash + + curl -I "http://localhost:3001/live" + +.. code-block:: http + + HTTP/1.1 200 OK + +Ready +----- + +In addition, the ``ready`` endpoint checks the state of the :ref:`connection_pool` and the :ref:`schema_cache`. A request will return ``200 OK`` if both are good or ``503`` if not. diff --git a/docs/references/health_check.rst b/docs/references/health_check.rst deleted file mode 100644 index dce5b58e9..000000000 --- a/docs/references/health_check.rst +++ /dev/null @@ -1,24 +0,0 @@ -.. _health_check: - -Health Check -############ - -You can enable a health check to verify if PostgREST is available for client requests. Also to check the status of its internal state. - -To do this, set the configuration variable :ref:`admin-server-port` to the port number of your preference. Two endpoints ``live`` and ``ready`` will then be available. - -The ``live`` endpoint verifies if PostgREST is running on its configured port. A request will return ``200 OK`` if PostgREST is alive or ``503`` otherwise. - -The ``ready`` endpoint also checks the state of both the Database Connection and the :ref:`schema_cache`. A request will return ``200 OK`` if it is ready or ``503`` if not. - -For instance, to verify if PostgREST is running at ``localhost:3000`` while the ``admin-server-port`` is set to ``3001``: - -.. code-block:: bash - - curl -I "http://localhost:3001/live" - -.. code-block:: http - - HTTP/1.1 200 OK - -If you have a machine with multiple network interfaces and multiple PostgREST instances in the same port, you need to specify a unique :ref:`hostname ` in the configuration of each PostgREST instance for the health check to work correctly. Don't use the special values(``!4``, ``*``, etc) in this case because the health check could report a false positive.