Monitor and troubleshoot DCM Projects¶
This topic describes how to monitor DCM deployments and troubleshoot failing DCM plans.
Troubleshoot a DCM project¶
If you are unfamiliar with the DCM project, you might run into errors from misconfigurations or other common pitfalls. This section describes those errors and how to resolve them.
Common causes for errors¶
The following table lists common causes for errors in a DCM project execution:
Error category |
Common causes |
|---|---|
Secondary roles |
|
Insufficient role privileges |
|
Jinja rendering issues |
|
Project issues |
|
Recommended troubleshooting steps¶
Follow these steps to troubleshoot and debug a DCM project.
Step |
Details |
|---|---|
Set secondary roles to none |
|
Use error messages from PLAN |
|
Narrow down |
|
Change the client |
|
Use Cortex Code for AI-assisted debugging |
|
Observe and audit DCM project deployments¶
DCM Projects are designed to provide full transparency and audit trails for all changes to your account infrastructure. This requires you to follow a few software development best practices for setting up infrastructure deployment processes. For more information, see Automate a DCM project deployment.
Use the following sources to review previous deployments:
Deployment artifacts stored inside the DCM project
Event logs from a DCM project (depending on log-level settings)
Deployment artifacts¶
For every executed deployment, an immutable snapshot of the deployment artifacts is stored inside the DCM project, with the following information:
The manifest file (
manifest.yml)All object definition and macro files (
.sqlfiles) inside thesourcesfolderThe output of the PLAN operation (
plan_result.json) and the DEPLOY operation (deploy_result.json), including:The templating variables used for this deployment
Deployment metadata, including timestamp, object name, and query ID
The changeset
This complete set makes all deployment actions reproducible for debugging, auditing, or redeploying the defined state.
The following commands are available for observing and auditing a DCM project:
With the MONITOR privilege, you can:
List all deployments stored inside the DCM project.
List all files inside a specified deployment.
Read, copy, or download specific files inside that deployment.
With the OWNERSHIP privilege, you can manually drop a deployment if it contains sensitive data.
With the READ privilege, you can run the DESCRIBE command to see the most recent deployment name, alias, and timestamp for a selected DCM project.
Example commands:
Deployment history¶
The INFORMATION_SCHEMA functions provide role-based access and low-latency ways to see successful and failed deployments for a selected DCM project.
The arguments project_name and result_limit are optional.
Example commands:
To see your deployment history in Snowsight:
In the navigation menu, select Catalog » Database Explorer.
Navigate to the schema that contains the DCM project.
Select the DCM project object to see its details.
Select the Deployment History tab to see a list of all deployments from this project object.
Select a deployment from the table to see more details about which objects were added, modified, or dropped.
Event logs¶
You can set the preferred LOG_LEVEL on the DCM project object or inherit the defined LOG_LEVEL from the parent schema, database, or account.
If the LOG_LEVEL for the DCM project is set, failed PLAN and DEPLOY executions are logged with the corresponding error messages as an event, and you can see them by querying the defined event table. For more information about setting up event tables and log levels, see Event table overview.
For example:
In the navigation menu, select Monitoring » Traces & logs.
Select the Logs tab.
Select the appropriate event table.
Filter by the project’s parent database or schema.