Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[database watcher] Improve storage utilization charts to show maximum storage size #2872

Merged
merged 5 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@
]
},
"tooltipFormat": {
"tooltip": "It is recommended that compute size of a geo-replication secondary replica matches the compute size of its primary replica. This instance has [\"local_logical_cpu_count\"] logical CPUs; its partner instance has [\"partner_logical_cpu_count\"] logical CPUs."
"tooltip": "It is recommended that compute size of a geo-replication secondary replica matches the compute size of its primary replica. This database or its elastic pool has [\"local_logical_cpu_count\"] logical CPUs; its partner database or elastic pool has [\"partner_logical_cpu_count\"] logical CPUs."
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"groupType": "editable",
"title": "Storage consumption details",
"expandable": true,
"expanded": true,
"items": [
{
"type": 1,
Expand All @@ -92,7 +93,7 @@
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "{\"version\":\"AzureDataExplorerQuery/1.0\",\"queryText\":\"datatable(key:int, metric_name:string) [\\r\\n1, \\\"Used data\\\",\\r\\n1, \\\"Allocated data\\\"\\r\\n]\\r\\n| join kind=inner\\r\\n(\\r\\nsqldb_database_storage_utilization\\r\\n| where sample_time_utc between ({timeRange:start} .. {timeRange:end})\\r\\n| where logical_server_name =~ @\\\"{serverName}\\\"\\r\\n| where database_name == @\\\"{databaseName}\\\"\\r\\n| where ({haReplica} and replica_type == \\\"HA secondary\\\") or (not ({haReplica}) and replica_type != \\\"HA secondary\\\")\\r\\n| extend key = int(1)\\r\\n) on key\\r\\n| project metric_name, sample_time_utc, data_size_used_mb, data_size_allocated_mb\\r\\n| extend metric = case(\\r\\n metric_name == \\\"Used data\\\", data_size_used_mb,\\r\\n metric_name == \\\"Allocated data\\\", data_size_allocated_mb,\\r\\n decimal(null)\\r\\n )\\r\\n| make-series metric = max(metric) default = long(null) on sample_time_utc from {timeRange:start} to {timeRange:end} step {timeRange:grain} by metric_name\\r\\n| project metric_name, metric = series_fill_forward(series_fill_linear(metric, int(null), false)), sample_time_utc\",\"clusterName\":\"{adxClusterUri}\",\"databaseName\":\"{adxDatabase}\"}",
"query": "{\"version\":\"AzureDataExplorerQuery/1.0\",\"queryText\":\"datatable(key:int, metric_name:string) [\\r\\n1, \\\"Used data\\\",\\r\\n1, \\\"Allocated data\\\",\\r\\n1, \\\"Max data\\\"\\r\\n]\\r\\n| join kind=inner\\r\\n(\\r\\nsqldb_database_storage_utilization\\r\\n| where sample_time_utc between ({timeRange:start} .. {timeRange:end})\\r\\n| where logical_server_name =~ @\\\"{serverName}\\\"\\r\\n| where database_name == @\\\"{databaseName}\\\"\\r\\n| where ({haReplica} and replica_type == \\\"HA secondary\\\") or (not ({haReplica}) and replica_type != \\\"HA secondary\\\")\\r\\n| extend key = int(1)\\r\\n) on key\\r\\n| project metric_name, sample_time_utc, data_size_used_mb, data_size_allocated_mb, data_max_size_mb\\r\\n| extend metric = case(\\r\\n metric_name == \\\"Used data\\\", data_size_used_mb,\\r\\n metric_name == \\\"Allocated data\\\", data_size_allocated_mb,\\r\\n metric_name == \\\"Max data\\\", data_max_size_mb,\\r\\n decimal(null)\\r\\n )\\r\\n| where (data_max_size_mb == -1 and metric_name != \\\"Max data\\\") or data_max_size_mb != -1\\r\\n| make-series metric = max(metric) default = long(null) on sample_time_utc from {timeRange:start} to {timeRange:end} step {timeRange:grain} by metric_name\\r\\n| project metric_name, metric = series_fill_forward(series_fill_linear(metric, int(null), false)), sample_time_utc\",\"clusterName\":\"{adxClusterUri}\",\"databaseName\":\"{adxDatabase}\"}",
"size": 1,
"aggregation": 5,
"showAnalytics": true,
Expand Down Expand Up @@ -124,6 +125,10 @@
{
"seriesName": "Used data",
"color": "green"
},
{
"seriesName": "Max data",
"color": "red"
}
],
"ySettings": {
Expand All @@ -145,7 +150,7 @@
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "{\"version\":\"AzureDataExplorerQuery/1.0\",\"queryText\":\"datatable(key:int, metric_name:string) [\\r\\n1, \\\"Used log\\\",\\r\\n1, \\\"Allocated log\\\"\\r\\n]\\r\\n| join kind=inner\\r\\n(\\r\\nsqldb_database_storage_utilization\\r\\n| where sample_time_utc between ({timeRange:start} .. {timeRange:end})\\r\\n| where logical_server_name =~ @\\\"{serverName}\\\"\\r\\n| where database_name == @\\\"{databaseName}\\\"\\r\\n| where ({haReplica} and replica_type == \\\"HA secondary\\\") or (not ({haReplica}) and replica_type != \\\"HA secondary\\\")\\r\\n| extend key = int(1)\\r\\n) on key\\r\\n| project metric_name, sample_time_utc, log_size_used_mb, log_size_allocated_mb\\r\\n| extend metric = case(\\r\\n metric_name == \\\"Used log\\\", log_size_used_mb,\\r\\n metric_name == \\\"Allocated log\\\", log_size_allocated_mb,\\r\\n decimal(null)\\r\\n )\\r\\n| make-series metric = max(metric) default = long(null) on sample_time_utc from {timeRange:start} to {timeRange:end} step {timeRange:grain} by metric_name\\r\\n| project metric_name, metric = series_fill_forward(series_fill_linear(metric, int(null), false)), sample_time_utc\",\"clusterName\":\"{adxClusterUri}\",\"databaseName\":\"{adxDatabase}\"}",
"query": "{\"version\":\"AzureDataExplorerQuery/1.0\",\"queryText\":\"datatable(key:int, metric_name:string) [\\r\\n1, \\\"Used log\\\",\\r\\n1, \\\"Allocated log\\\",\\r\\n1, \\\"Max log\\\"\\r\\n]\\r\\n| join kind=inner\\r\\n(\\r\\nsqldb_database_storage_utilization\\r\\n| where sample_time_utc between ({timeRange:start} .. {timeRange:end})\\r\\n| where logical_server_name =~ @\\\"{serverName}\\\"\\r\\n| where database_name == @\\\"{databaseName}\\\"\\r\\n| where ({haReplica} and replica_type == \\\"HA secondary\\\") or (not ({haReplica}) and replica_type != \\\"HA secondary\\\")\\r\\n| extend key = int(1)\\r\\n) on key\\r\\n| project metric_name, sample_time_utc, log_size_used_mb, log_size_allocated_mb, log_max_size_mb\\r\\n| extend metric = case(\\r\\n metric_name == \\\"Used log\\\", log_size_used_mb,\\r\\n metric_name == \\\"Allocated log\\\", log_size_allocated_mb,\\r\\n metric_name == \\\"Max log\\\", log_max_size_mb,\\r\\n decimal(null)\\r\\n )\\r\\n| make-series metric = max(metric) default = long(null) on sample_time_utc from {timeRange:start} to {timeRange:end} step {timeRange:grain} by metric_name\\r\\n| project metric_name, metric = series_fill_forward(series_fill_linear(metric, int(null), false)), sample_time_utc\",\"clusterName\":\"{adxClusterUri}\",\"databaseName\":\"{adxDatabase}\"}",
"size": 1,
"aggregation": 5,
"showAnalytics": true,
Expand Down Expand Up @@ -177,6 +182,10 @@
{
"seriesName": "Used log",
"color": "green"
},
{
"seriesName": "Max log",
"color": "red"
}
],
"ySettings": {
Expand All @@ -198,7 +207,7 @@
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "{\"version\":\"AzureDataExplorerQuery/1.0\",\"queryText\":\"datatable(key:int, metric_name:string) [\\r\\n1, \\\"Used tempdb data\\\",\\r\\n1, \\\"Allocated tempdb data\\\"\\r\\n]\\r\\n| join kind=inner\\r\\n(\\r\\nsqldb_database_storage_utilization\\r\\n| where sample_time_utc between ({timeRange:start} .. {timeRange:end})\\r\\n| where logical_server_name =~ @\\\"{serverName}\\\"\\r\\n| where database_name == @\\\"{databaseName}\\\"\\r\\n| where ({haReplica} and replica_type == \\\"HA secondary\\\") or (not ({haReplica}) and replica_type != \\\"HA secondary\\\")\\r\\n| extend key = int(1)\\r\\n) on key\\r\\n| project metric_name, sample_time_utc, tempdb_data_size_used_mb, tempdb_data_size_allocated_mb\\r\\n| extend metric = case(\\r\\n metric_name == \\\"Used tempdb data\\\", tempdb_data_size_used_mb,\\r\\n metric_name == \\\"Allocated tempdb data\\\", tempdb_data_size_allocated_mb,\\r\\n decimal(null)\\r\\n )\\r\\n| make-series metric = max(metric) default = long(null) on sample_time_utc from {timeRange:start} to {timeRange:end} step {timeRange:grain} by metric_name\\r\\n| project metric_name, metric = series_fill_forward(series_fill_linear(metric, int(null), false)), sample_time_utc\",\"clusterName\":\"{adxClusterUri}\",\"databaseName\":\"{adxDatabase}\"}",
"query": "{\"version\":\"AzureDataExplorerQuery/1.0\",\"queryText\":\"datatable(key:int, metric_name:string) [\\r\\n1, \\\"Used tempdb data\\\",\\r\\n1, \\\"Allocated tempdb data\\\",\\r\\n1, \\\"Max tempdb data\\\"\\r\\n]\\r\\n| join kind=inner\\r\\n(\\r\\nsqldb_database_storage_utilization\\r\\n| where sample_time_utc between ({timeRange:start} .. {timeRange:end})\\r\\n| where logical_server_name =~ @\\\"{serverName}\\\"\\r\\n| where database_name == @\\\"{databaseName}\\\"\\r\\n| where ({haReplica} and replica_type == \\\"HA secondary\\\") or (not ({haReplica}) and replica_type != \\\"HA secondary\\\")\\r\\n| extend key = int(1)\\r\\n) on key\\r\\n| project metric_name, sample_time_utc, tempdb_data_size_used_mb, tempdb_data_size_allocated_mb, tempdb_data_max_size_mb\\r\\n| extend metric = case(\\r\\n metric_name == \\\"Used tempdb data\\\", tempdb_data_size_used_mb,\\r\\n metric_name == \\\"Allocated tempdb data\\\", tempdb_data_size_allocated_mb,\\r\\n metric_name == \\\"Max tempdb data\\\", tempdb_data_max_size_mb,\\r\\n decimal(null)\\r\\n )\\r\\n| make-series metric = max(metric) default = long(null) on sample_time_utc from {timeRange:start} to {timeRange:end} step {timeRange:grain} by metric_name\\r\\n| project metric_name, metric = series_fill_forward(series_fill_linear(metric, int(null), false)), sample_time_utc\",\"clusterName\":\"{adxClusterUri}\",\"databaseName\":\"{adxDatabase}\"}",
"size": 1,
"aggregation": 5,
"showAnalytics": true,
Expand Down Expand Up @@ -230,6 +239,10 @@
{
"seriesName": "Used tempdb data",
"color": "green"
},
{
"seriesName": "Max tempdb data",
"color": "red"
}
],
"ySettings": {
Expand All @@ -251,7 +264,7 @@
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "{\"version\":\"AzureDataExplorerQuery/1.0\",\"queryText\":\"datatable(key:int, metric_name:string) [\\r\\n1, \\\"Used tempdb log\\\",\\r\\n1, \\\"Allocated tempdb log\\\"\\r\\n]\\r\\n| join kind=inner\\r\\n(\\r\\nsqldb_database_storage_utilization\\r\\n| where sample_time_utc between ({timeRange:start} .. {timeRange:end})\\r\\n| where logical_server_name =~ @\\\"{serverName}\\\"\\r\\n| where database_name == @\\\"{databaseName}\\\"\\r\\n| where ({haReplica} and replica_type == \\\"HA secondary\\\") or (not ({haReplica}) and replica_type != \\\"HA secondary\\\")\\r\\n| extend key = int(1)\\r\\n) on key\\r\\n| project metric_name, sample_time_utc, tempdb_log_size_used_mb, tempdb_log_size_allocated_mb\\r\\n| extend metric = case(\\r\\n metric_name == \\\"Used tempdb log\\\", tempdb_log_size_used_mb,\\r\\n metric_name == \\\"Allocated tempdb log\\\", tempdb_log_size_allocated_mb,\\r\\n decimal(null)\\r\\n )\\r\\n| make-series metric = max(metric) default = long(null) on sample_time_utc from {timeRange:start} to {timeRange:end} step {timeRange:grain} by metric_name\\r\\n| project metric_name, metric = series_fill_forward(series_fill_linear(metric, int(null), false)), sample_time_utc\",\"clusterName\":\"{adxClusterUri}\",\"databaseName\":\"{adxDatabase}\"}",
"query": "{\"version\":\"AzureDataExplorerQuery/1.0\",\"queryText\":\"datatable(key:int, metric_name:string) [\\r\\n1, \\\"Used tempdb log\\\",\\r\\n1, \\\"Allocated tempdb log\\\",\\r\\n1, \\\"Max tempdb log\\\"\\r\\n]\\r\\n| join kind=inner\\r\\n(\\r\\nsqldb_database_storage_utilization\\r\\n| where sample_time_utc between ({timeRange:start} .. {timeRange:end})\\r\\n| where logical_server_name =~ @\\\"{serverName}\\\"\\r\\n| where database_name == @\\\"{databaseName}\\\"\\r\\n| where ({haReplica} and replica_type == \\\"HA secondary\\\") or (not ({haReplica}) and replica_type != \\\"HA secondary\\\")\\r\\n| extend key = int(1)\\r\\n) on key\\r\\n| project metric_name, sample_time_utc, tempdb_log_size_used_mb, tempdb_log_size_allocated_mb, tempdb_log_max_size_mb\\r\\n| extend metric = case(\\r\\n metric_name == \\\"Used tempdb log\\\", tempdb_log_size_used_mb,\\r\\n metric_name == \\\"Allocated tempdb log\\\", tempdb_log_size_allocated_mb,\\r\\n metric_name == \\\"Max tempdb log\\\", tempdb_log_max_size_mb,\\r\\n decimal(null)\\r\\n )\\r\\n| make-series metric = max(metric) default = long(null) on sample_time_utc from {timeRange:start} to {timeRange:end} step {timeRange:grain} by metric_name\\r\\n| project metric_name, metric = series_fill_forward(series_fill_linear(metric, int(null), false)), sample_time_utc\",\"clusterName\":\"{adxClusterUri}\",\"databaseName\":\"{adxDatabase}\"}",
"size": 1,
"aggregation": 5,
"showAnalytics": true,
Expand Down Expand Up @@ -283,6 +296,10 @@
{
"seriesName": "Used tempdb log",
"color": "green"
},
{
"seriesName": "Max tempdb log",
"color": "red"
}
],
"ySettings": {
Expand Down Expand Up @@ -371,7 +388,6 @@
"groupType": "editable",
"title": "Storage IO statistics",
"expandable": true,
"expanded": true,
"items": [
{
"type": 1,
Expand Down
Loading
Loading