Azure Resource Graph Explorer::在时间图表中绘制趋势线

标签 azure azure-sql-database kql azure-resource-graph

我正在读这篇文章article了解如何在与 Azure SQL 数据库消耗相关的时间图表中绘制趋势线。

查询是这样的:

AzureMetrics
| where TimeGenerated >= ago(90d)
| where Resource == 'MyDB'
| where MetricName == 'full_backup_size_bytes' // in ('full_backup_size_bytes','diff_backup_size_bytes','log_backup_size_bytes')
| make-series SizeBackupDiffTB=max(Maximum/1024/1024/1024/1024) on TimeGenerated in range(ago(90d),now(), 1d)
| extend (RSquare,Slope,Variance,RVariance,Interception,TrendLine)=series_fit_line(SizeBackupDiffTB)
| render timechart

但是 Azure 门户返回此错误:

Please provide below info when asking for support: timestamp = 2022-12-19T09:09:42.5539654Z, correlationId = 9cfa2a61-7cbe-412d-8e21-20b245a0e7da. (Code:BadRequest)

Details:
Query is invalid. Please refer to the documentation for the Azure Resource Graph service and fix the error before retrying. (Code:InvalidQuery)
ParserFailure (Code:ParserFailure)
ParserFailure (Code:ParserFailure)
ParserFailure (Code:ParserFailure)
ParserFailure (Code:ParserFailure)
ParserFailure (Code:ParserFailure)
ParserFailure (Code:ParserFailure)

我认为问题可能出现在第二行>=

但这意味着什么?

编辑:我认为存在不止一个问题,因为它不需要 make-seriesrender timechart:

enter image description here

但是错误现在减少了:

Please provide below info when asking for support: timestamp = 2022-12-19T09:37:04.2221903Z, correlationId = 12157f78-2c92-4820-94d6-f088acf1a5a0. (Code:BadRequest)

Details:
Query is invalid. Please refer to the documentation for the Azure Resource Graph service and fix the error before retrying. (Code:InvalidQuery)
ParserFailure (Code:ParserFailure)
ParserFailure (Code:ParserFailure)
ParserFailure (Code:ParserFailure)
More information on the error can be found here.

最佳答案

这可能是 greater-than 的 Unicode这没有得到正确反射(reflect)。您应该在 Log Analytics 中尝试以下操作:

AzureMetrics
| where TimeGenerated >= ago(90d)
| where Resource == 'MyDB'
| where MetricName == 'full_backup_size_bytes' // in ('full_backup_size_bytes','diff_backup_size_bytes','log_backup_size_bytes')
| make-series SizeBackupDiffTB=max(Maximum/1024/1024/1024/1024) on TimeGenerated in range(ago(90d),now(), 1d)
| extend (RSquare,Slope,Variance,RVariance,Interception,TrendLine)=series_fit_line(SizeBackupDiffTB)
| render timechart

关于Azure Resource Graph Explorer::在时间图表中绘制趋势线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74848452/

相关文章:

azure - Quarkus Function 应用程序与托管身份连接

c# - 使用 R 对 DocumentDB 资源进行访问控制

Azure容器实例: image from public docker leads to InaccessibleImage error

azure - 有没有办法使用 KQL 更新和显示 Azure 应用程序见解请求正文中的字段?

azure - 如何使用 Azure ARM 模板在 Azure SQL Server 中一次添加多个客户端 IP 地址?

azure - 将文件从本地复制到 azure

azure-data-explorer - Kusto 查询过去 21 天内的最早和最晚日期

azure - 如何在azure KQL中列出LogEntry中的所有json key

azure-log-analytics - KQL 查询 - 在 where 子句中相对选择今天的数据

Azure Functions 内存/消耗单位使用情况