To analyze the daily runtime hours and associated costs of your Azure Synapse workspace, follow these steps:
Understanding Synapse Workspace Usage - Azure Synapse Analytics costs depend on:
Compute Resources - Dedicated SQL pools (billed per active hour), Spark pools, and serverless SQL (billed per query).
Storage Costs - Charges for data stored in Synapse.
Data Movement - Costs incurred when transferring data in/out.
Tracking Runtime Data - To track daily runtime hours, use Azure Monitor and Azure Activity Logs:
Azure Monitor - Logs SQL pool start/stop times.
Activity Logs - Check when the pool was active.
KQL Query to Track SQL Pool Activity in Log Analytics
AzureDiagnostics
| where ResourceType == "DATABASES"
| where Resource == "<Your-SQL-Pool-Name>"
| project TimeGenerated, Resource, OperationName, ActivityStatus
This query helps identify start/stop events to calculate daily runtime.
Calculating Daily Runtime Hours
Dedicated SQL Pools - Sum up the duration between start and pause events.
Serverless SQL Pools - Monitor query execution time (no continuous runtime).
Estimating Costs
Use Azure Cost Management + Billing to filter Synapse costs by date.
Formula:
Total Cost=Runtime Hours×Cost per Hour\text{Total Cost} = \text{Runtime Hours} \times \text{Cost per Hour}Total Cost=Runtime Hours×Cost per Hour
https://learn.microsoft.com/en-us/azure/cost-management-billing/costs/pricing-calculator
https://learn.microsoft.com/en-us/azure/azure-monitor/logs/log-query-overview
I hope this information helps.
Kindly consider upvoting the comment if the information provided is helpful. This can assist other community members in resolving similar issues.