Use Query Labels in Microsoft Fabric Warehouse for Better Workload Monitoring
- gowheya
- Mar 12
- 3 min read
As organisations adopt Microsoft Fabric Data Warehouse for analytics, reporting, and ETL pipelines, thousands of queries can run daily across different workloads—Warehouses, BI reports, data pipelines, ad-hoc analysis, and automated processes.
Without clear identifiers, it becomes difficult to determine:
Which queries power critical reports and dashboards
Which pipelines are consuming the most compute
Which workloads are causing performance bottlenecks
Query Labels in Fabric Warehouse provide a simple but powerful way to solve this problem. By tagging SQL queries with meaningful labels, teams can easily monitor, analyse, and troubleshoot query workloads using Fabric’s monitoring tools.
What Are Query Labels?
A query label is metadata that can be attached to a SQL query in Fabric Warehouse or the SQL analytics endpoint.
The label acts as an identifier that allows engineers to:
Track queries in Query Insights views
Monitor workload performance
Analyse execution history
Troubleshoot slow or expensive queries
Instead of searching raw SQL text, you can simply filter queries by their label name.
Query Label Syntax
Adding a label to a query is simple. You include the OPTION (LABEL = '<label>') clause at the end of the SQL statement.
Syntax
SELECT ...FROM ...OPTION (LABEL = 'label_name');
The label can contain any meaningful identifier describing the query workload.
Example 1: Label a Dashboard Query
If a query powers a sales dashboard, you can tag it with a label.
SELECT
FinanceKey,
DateKey,
OrganizationKey,
DepartmentGroupKey,
SUM(Amount) AS TotalAmount
FROM dbo.FactFinance
WHERE OrganizationKey = 13AND DepartmentGroupKey = 103
GROUP BY FinanceKey, DateKey, OrganizationKey, DepartmentGroupKey
OPTION (LABEL = 'SALES_DASHBOARD');

This makes it easy to track the query’s performance across executions.
Example 2: Monitor Long Running Queries
Once labelled queries run, they can be monitored using Query Insights system views:
SELECT * FROM queryinsights.long_running_queries
WHERE last_run_command LIKE '%SALES_DASHBOARD%'ORDER BY median_total_elapsed_time_ms DESC;

This helps identify slow-running queries associated with specific workloads.
Example 3: View Query Execution History
You can also analyse execution history for labelled queries:
SELECT *FROM queryinsights.exec_requests_history
WHERE label = 'SALES_DASHBOARD'ORDER BY submit_time DESC;

This view allows engineers to monitor:
Execution frequency
Runtime performance
Historical workload trends
Why Query Labels Matter
1. Better Workload Visibility
Query labels make it easy to identify which workloads are running in the warehouse, such as dashboards, reports, or ETL jobs.
2. Faster Performance Troubleshooting
When a performance issue occurs, labels help quickly identify the responsible workload.
Examples:
ETL_PATIENT_LOAD
POWERBI_WAITLIST_DASHBOARD
FINANCE_MONTHLY_REPORT
3. Improved Governance
In enterprise environments with multiple teams, labels help organise and monitor workloads across departments.
Typical workload categories include:
Dashboards
ETL pipelines
Reporting queries
Ad-hoc analytics
4. Monitoring Critical Queries
Labels allow teams to track high-value queries powering:
Production dashboards
Data pipelines
Regulatory reporting workloads
Practical Tips for Using Query Labels
1.Use a Naming Convention
Consistent naming helps maintain clarity across teams.
Example:
DASHBOARD_<name>ETL_<process>REPORT_<department>PIPELINE_<workflow>
Examples:
ETL_PATIENT_ADMISSIONS_LOAD
DASHBOARD_WAITLIST_METRICS
REPORT_FINANCE_MONTHLY
2.Label Important Workloads
Focus on labelling queries that are:
Part of production ETL pipelines
Used in dashboards or reports
Known to consume significant compute
Long running or performance sensitive
3.Combine With Monitoring Views
Query labels are most useful when used with Query Insights views, including:
queryinsights.exec_requests_history
queryinsights.long_running_queries
These views provide detailed telemetry about query execution.
Example: Healthcare Data Warehouse
In a healthcare analytics platform (such as NHS reporting), labels could track different workloads across the medallion architecture.
Label | Purpose |
ETL_PATIENT_ACTIVITY_LOAD | Bronze → Silver ingestion pipeline |
ETL_WAITLIST_AGGREGATION | Gold metric aggregation |
DASHBOARD_AE_PERFORMANCE | Emergency department dashboard |
REPORT_FINANCE_MONTHLY | Finance reporting |
This allows platform teams to quickly identify which workloads affect performance.
Key Considerations
Query labels must be manually added to SQL statements
Query insights views may take up to 15 minutes to show completed queries
Governance relies on maintaining consistent naming standards
Despite these considerations, query labels significantly improve the observability and management of warehouse workloads.
Conclusion
Query labels are a small feature with a big impact in Microsoft Fabric Data Warehouse. By simply tagging SQL queries with meaningful identifiers, teams gain better visibility into workloads, faster troubleshooting capabilities, and improved operational governance.
In large data platforms supporting dashboards, pipelines, and enterprise reporting, query labels help turn complex query activity into manageable and observable workloads.
Call to Action
If you are building solutions in Microsoft Fabric, consider adopting query labels as part of your development standards.
Start by:
Identifying critical queries powering reports, dashboards or pipelines
Adding labels using OPTION (LABEL = 'name')
Monitoring labelled queries using Query Insights views
Establishing naming conventions across engineering teams
This simple practice can greatly improve performance monitoring, workload management, and governance in your Fabric Warehouse environment.
References
Microsoft Documentation:



Comments