series_fir 未在应用程序洞察图表上生成移动平均线

series_fir not generating moving average on application insights chart

鉴于以下 Kusto query

range t from bin(now(), 1h)-23h to bin(now(), 1h) step 1h
| summarize t=make_list(t)
| project id='TS', val=dynamic([0,0,0,0,0,0,0,0,0,10,20,40,100,40,20,10,0,0,0,0,0,0,0,0]), t
| extend 5h_MovingAvg=series_fir(val, dynamic([1,1,1,1,1])),
     5h_MovingAvg_centered=series_fir(val, dynamic([1,1,1,1,1]), true, true)
| render timechart  

我无法获得应用程序洞察力来实际绘制 this document

中所示的移动平均线

我也曾尝试将这篇文章应用到我们的一个实际应用程序中,但也没有成功。没有错误或任何线索可以说明为什么没有绘制移动平均线。我假设某处有一个很可能必须设置的设置。这是我的自定义查询:

let timeGrain=1d;
let ago = ago(7d);
let mAvgParm = repeat(1, 5);
let dataset=requests
// additional filters can be applied here
| where timestamp >= ago and cloud_RoleName == "recalculateordercombination" and resultCode == 500
| where client_Type != "Browser" ;
// calculate failed request count for all requests
dataset
| make-series dailyFailure=sum(itemCount) default=0 on timestamp in range(ago, now(), timeGrain) by resultCode
// render result in a chart
| extend SMA = series_fir(dailyFailure, mAvgParm)
| render timechart 

为了使用 series_fir 绘制移动平均线,缺少哪些查询?

参考我研究中使用的文章

两种服务的 Web 客户端不同,它们的呈现逻辑也是如此。

在 Azure 数据资源管理器 (Kusto) 中,您可以只对 time-series 数据(类型为 dynamic)使用 render timechart

在其他情况下,您可能需要先 mv-expand 系列 (link to doc),然后再渲染它。

这是一个与您问题中的第一个查询匹配的示例:

range t from bin(now(), 1h)-23h to bin(now(), 1h) step 1h
| summarize t=make_list(t)
| project id='TS', val=dynamic([0,0,0,0,0,0,0,0,0,10,20,40,100,40,20,10,0,0,0,0,0,0,0,0]), t
| extend 5h_MovingAvg=series_fir(val, dynamic([1,1,1,1,1])),
     5h_MovingAvg_centered=series_fir(val, dynamic([1,1,1,1,1]), true, true)
| mv-expand val to typeof(long), t to typeof(datetime), 5h_MovingAvg to typeof(long), 5h_MovingAvg_centered to typeof(long)
| project t, 5h_MovingAvg, 5h_MovingAvg_centered, val
| render timechart