Billing Anomaly Alert Configuration Guide
Singdata Lakehouse Billing Anomaly Alert Configuration Guide
Overview
This guide helps you quickly configure a billing anomaly monitoring system to trigger automatic alerts when costs surge unexpectedly, ensuring cost safety.
Prerequisites
- Have the instance_admin role permission to query billing data from the sys.information_schema.instance_usage view.
- Have the instance_sre role permission to use the "Data Quality" and "Monitoring & Alerting" features.
- Have access to a compute cluster in a workspace (for executing quality rule query SQL) and metadata query (read metadata) permission on a table or view (for configuring quality rules).
Data Used
The fields and content of the sys.information_schema.instance_usage view are described in the appendix at the end of this document.
Configuration Steps
Step 1: Create a Data Quality Rule
1. Enter the Data Quality Management module
2. Click Create Quality Rule

3. Fill in basic information:

In this case, focus on the following three options:
- Verification Method: Select "Custom SQL";
- Based on the recommended rules in this document, paste the SQL directly into the text box;
- Under "Expected Result", configure the corresponding condition and value based on the selected rule.
For other field configurations, refer to the complete Data Quality configuration documentation: Data Quality
Step 2: Configure Monitoring & Alerting
1. Enter the Monitoring & Alerting module and click Create Rule

2. Configure the alert rule
In this case, focus on the following three options:
-
Monitoring Item: Select the Data Quality Monitoring Failed alert type, and add filter conditions to effectively exclude other quality rules, avoiding interference caused by failures of other quality rule checks.
-
Notification Policy: Choose the desired notification policy based on actual needs. You can also create a new notification policy separately. For notification policy configuration details, refer to the documentation: Monitoring & Alerting System.
-
Notified Users: Select relevant personnel who need to be aware of billing issues. You can add users to this list by creating new users in the Account Center.

Once the above two steps are completed, the full process from monitoring to alerting is set up. When a quality rule detects an anomaly, you will receive alert notifications through the corresponding channels.
The following section details the available monitoring rules for data quality rules.
Monitoring Solutions
Solution 1: Fixed Threshold Monitoring (Simple and Fast)
Applicable Scenario: Costs are relatively stable with a clear budget ceiling.
Monitoring SQL:
Alert Configuration:
- Expected result <= 50 (adjust the threshold according to actual needs)
- Trigger alert when the threshold is exceeded
Threshold Reference Query:
Solution 2: Dynamic Baseline Monitoring (Focusing on Anomalous Fluctuations)
Applicable Scenario: Costs exhibit a stable upward or downward trend, requiring attention to cost fluctuations rather than absolute values.
Monitoring SQL:
Alert Configuration:
- Expected result <= 1.5 (i.e., yesterday's cost does not exceed 1.5 times the historical median)
- Adjust the multiplier based on business characteristics:
- 1.5x: Sensitive monitoring
- 2.0x: Standard monitoring
- 3.0x: Relaxed monitoring
Baseline Threshold Auxiliary Analysis SQL:
If you are unsure about the appropriate expected result value, you can execute the following SQL to obtain the tp90, tp95, and tp99 values from the past 30 days as a reference:
Cost Attribution Analysis SQL
The following queries are used to identify monitoring targets before configuring alerts, or to locate cost sources after an alert is triggered.
Compute Cost Summary by Workspace for the Current Month
Storage Cost Summary by Workspace for the Current Month
Combined Storage and Compute Cost
Compute Cost Trend for the Past 30 Days
Notes on Cost Views
sys.information_schema.instance_usagerecords daily-aggregated compute billing data including amounts;job_history.crurecords per-job consumption without final amounts and cannot substitute for the cost view.sys.information_schema.storage_meteringrecords storage and network costs; common SKUs include managed storage capacity, multi-version undeleted storage, and data query Internet data transfer.workspace_namemay be NULL, indicating instance-level costs not attributed to a specific workspace.amountis the original amount;total_after_discountis the discounted amount. Alert rules should preferably useCOALESCE(total_after_discount, amount * discount_rate).
Monitoring Effect Verification
- Manual Test: After configuring the quality rule, you can perform a trial run to verify the correctness of the quality rule configuration and the SQL.
- Alert Testing: During the trial run, you can (manually) trigger the alert to verify the notification functionality, confirming that the notification policy configuration is correct.
- Historical Review: Review the billing data from the past 7 days to confirm the reasonableness of the threshold.
By following the above steps, you can quickly set up a billing anomaly alert system and effectively control cost risks.
