Observability for Snowflake App Runtime

This topic describes how to inspect the state of a running Application Service and how to read its container logs. In Cortex Code CLI or Cortex Code Desktop, you can ask the agent to check status, show logs, or diagnose deployment issues. For example: Show me the logs for my warehouse-monitor app.

Check service status

Use SHOW APPLICATION SERVICES to list services you can see, along with their current state, deployed package, and version:

SHOW APPLICATION SERVICES;

Use DESCRIBE APPLICATION SERVICE to inspect a single service in more detail:

DESCRIBE APPLICATION SERVICE my_db.my_schema.my_app;

A service can be in one of the following states:

  • PENDING: the service is starting up.
  • RUNNING: the service is running and can accept requests.
  • SUSPENDING: a suspend is in progress.
  • SUSPENDED: the service is stopped and not billing compute.
  • FAILED: a container in the service encountered an unrecoverable error.
  • DONE: the service ran to completion (job-style runs only).
  • CANCELLED: a job-style run was cancelled.
  • DELETING: a drop is in progress.
  • DELETED: the service has been dropped.
  • INTERNAL_ERROR: the service is in an unexpected internal state.

Read container logs

The fastest way to read container logs is with the Snowflake CLI:

snow app events
snow app events --last 1000

By default, the command returns the 500 most recent log lines for the Application Service defined in your snowflake.yml.

You can also read logs directly with SQL using SYSTEM$GET_APPLICATION_SERVICE_LOGS. The function takes the fully qualified service name and, optionally, the number of tail lines to return (the default is 500):

SELECT SYSTEM$GET_APPLICATION_SERVICE_LOGS('my_db.my_schema.my_app');
SELECT SYSTEM$GET_APPLICATION_SERVICE_LOGS('my_db.my_schema.my_app', 1000);

The role that reads logs needs the MONITOR privilege on the service.

Use an event table for structured logs

For persistent, queryable logs, configure an active event table on your account and emit structured logs from your application code. The event table receives logs, metrics, and traces emitted by your containers and by Snowflake. For more information, see Logging, tracing, and metrics.