从 KQL 访问仪表板的时间范围和粒度

Access dashboard's time range and granularity from KQL

我已将使用 KQL 的图表和来自 Azure Log Analytics 的日志添加到仪表板。我正在使用 make-series,效果很好,但问题如下:

我得到的日志可能不会扩展到仪表板规定的整个时间范围。所以基本上我需要访问 starttime/endtime(和时间粒度)以使 make-series 覆盖整个时间范围。

例如

logs
| make-series
    P90 = percentile(Elapsed, 90) default = 0,
    Average = avg(Elapsed) default = 0
    // ??? need start/end time to use in from/to
    on TimeGenerated step 1m

目前不支持。有一些关于此功能的反馈:Support for time granularity selected in Azure Portal Dashboard, and Retrieve the portal time span and use it inside the kusto query.

有人在the first feedback中提供了解决方法,你可以试一试。