Azure Kusto 时间序列
Azure Kusto time series
我们在使用 Azure Kusto 中的时间图表时遇到了一些问题。
在此图表中,我们对一段时间内的 http 异常进行了分组。
问题是图表仍然报告不存在该异常的时间点的最后一次看到的值。
见红色标记。
在此特定情况下,我们看到图表在 5:28 的 /poll 端点上报告了 3.23k 个异常。而当时实际上并没有这样的错误。
查询看起来像这样
AppServiceHTTPLogs
| where TimeGenerated > ago(1d)
| where ScStatus >= 500
| summarize count() by tostring(CsUriStem), bin(TimeGenerated, 30m)
| render timechart
使用柱形图可以解决问题,但代价是变得不那么清晰了。
还有其他选择吗?
我们能否以某种方式让缺失值默认为 0?
您应该能够使用 make-series 运算符填充默认零:
https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/make-seriesoperator
AppServiceHTTPLogs
| where TimeGenerated > ago(1d)
| where ScStatus >= 500
| make-series count() on TimeGenerated from ago(1d) to now() step 30min by tostring(CsUriStem)
| render timechart
一些 UX 客户端不知道如何表示系列数据 - 在这种情况下,您可以使用 mv-expand 扩展它:
AppServiceHTTPLogs
| where TimeGenerated > ago(1d)
| where ScStatus >= 500
| make-series count() on TimeGenerated from ago(1d) to now() step 30min by tostring(CsUriStem)
| mv-expand count_ to typeof(long)
| render timechart
我们在使用 Azure Kusto 中的时间图表时遇到了一些问题。 在此图表中,我们对一段时间内的 http 异常进行了分组。
问题是图表仍然报告不存在该异常的时间点的最后一次看到的值。 见红色标记。 在此特定情况下,我们看到图表在 5:28 的 /poll 端点上报告了 3.23k 个异常。而当时实际上并没有这样的错误。
查询看起来像这样
AppServiceHTTPLogs
| where TimeGenerated > ago(1d)
| where ScStatus >= 500
| summarize count() by tostring(CsUriStem), bin(TimeGenerated, 30m)
| render timechart
使用柱形图可以解决问题,但代价是变得不那么清晰了。 还有其他选择吗?
我们能否以某种方式让缺失值默认为 0?
您应该能够使用 make-series 运算符填充默认零:
https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/make-seriesoperator
AppServiceHTTPLogs
| where TimeGenerated > ago(1d)
| where ScStatus >= 500
| make-series count() on TimeGenerated from ago(1d) to now() step 30min by tostring(CsUriStem)
| render timechart
一些 UX 客户端不知道如何表示系列数据 - 在这种情况下,您可以使用 mv-expand 扩展它:
AppServiceHTTPLogs
| where TimeGenerated > ago(1d)
| where ScStatus >= 500
| make-series count() on TimeGenerated from ago(1d) to now() step 30min by tostring(CsUriStem)
| mv-expand count_ to typeof(long)
| render timechart