View the Native App's Status
Use this guide to inspect the app service metadata and confirm whether the RAI Native App is ready to use. It explains what the app’s status procedures tell you and how to use them to check common service health questions in SQL or through a Python client.
- The RAI Native App is already installed in your Snowflake account.
- You can run SQL in Snowflake with an active warehouse.
Check that the RAI service is running
Section titled “Check that the RAI service is running”Requires the app_user application role.
Use app.service_status() to check whether the RAI service containers are running and ready:
Call the app.service_status() procedure:
CALL relationalai.app.service_status();+----------------------------------------------+| [ || { || "message": "Running", || "name": "main", || "restartCount": 0, || "startTime": "2024-10-27T22:10:05Z", || "status": "READY" || }, || { || "message": "Running", || "name": "otel-collector", || "restartCount": 0, || "startTime": "2024-10-27T22:10:07Z", || "status": "READY" || }, || { || "message": "Running", || "name": "registry", || "restartCount": 0, || "startTime": "2024-10-27T22:10:06Z", || "status": "READY" || } || ] |+----------------------------------------------+Create a Snowpark session from your default PyRel connection with create_config(), then call the app.service_status() SQL procedure:
from relationalai.config import create_config
session = create_config().get_session()
status = session.sql("CALL relationalai.app.service_status()").collect()print(status)- If each container’s status is
READY, the service is activated and ready to use. - If one or more containers report a status such as
SUSPENDEDorSUSPENDING, the service is stopped and not ready to use. - If the call to
app.service_status()fails, the service may not exist, which can occur after a deeper shutdown that drops the service instead of just suspending it.
Check if the RAI service is stopped
Section titled “Check if the RAI service is stopped”Requires the app_user application role.
You can shut down the RAI Native App in order to reduce costs during periods of inactivity. When the app is stopped, the app’s SPCS service can either be suspended or fully dropped, depending on the shutdown method used and how long ago the shutdown occurred.
Follow these steps to check whether the service has been suspended or dropped:
-
Check whether the service still exists
Run
app.get_service():CALL relationalai.app.get_service();This step tells you whether Snowflake still has a managed app service to inspect.
- If
app.get_service()returns service metadata, the service still exists. - If
app.get_service()shows no service metadata, the service was removed during a deeper shutdown and must be created again before it can start.
- If
-
Check whether the existing service is stopped or running
If the service still exists, run
app.service_status():CALL relationalai.app.service_status();This step tells you whether the existing service is stopped, still starting, or ready to use.
If the service still exists but is stopped,
app.service_status()can return output like this:Example +----------------------------------------------+| [ || { || "message": "Suspended", || "name": "main", || "restartCount": 0, || "startTime": "2024-10-27T22:10:05Z", || "status": "SUSPENDED" || }, || { || "message": "Suspended", || "name": "otel-collector", || "restartCount": 0, || "startTime": "2024-10-27T22:10:07Z", || "status": "SUSPENDED" || }, || { || "message": "Suspended", || "name": "registry", || "restartCount": 0, || "startTime": "2024-10-27T22:10:06Z", || "status": "SUSPENDED" || } || ] |+----------------------------------------------+- If
app.service_status()returns container entries with a status such asSUSPENDEDorSUSPENDING, the service exists but is stopped and not ready to use. - If each container reports
READY, the service is running rather than stopped. - If the service was dropped during a deeper shutdown,
app.service_status()may fail because there is no service to inspect.
- If
Check whether startup is still in progress
Section titled “Check whether startup is still in progress”Requires the app_user application role.
Use app.service_status() when the app was recently started and you want to see whether Snowflake is still bringing the service online:
Call the app.service_status() procedure:
CALL relationalai.app.service_status();+-----------------------------------+| [ || { || "message": null, || "name": null, || "restartCount": null, || "startTime": null, || "status": "PENDING" || } || ] |+-----------------------------------+Create a Snowpark session from your default PyRel connection with create_config(), then call the app.service_status() SQL procedure:
from relationalai.config import create_config
session = create_config().get_session()
status = session.sql("CALL relationalai.app.service_status()").collect()print(status)- Look for
status=PENDINGto confirm that startup is still in progress. - While the service is still
PENDING, Snowflake can returnNULLforname,message,restartCount, andstartTimebecause the service containers are not ready yet. - Keep calling
app.service_status()until the returned status changes toREADY.