You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Application Insights中查询重试策略触发的Azure函数调用?

查询Azure函数重试触发的调用(Application Insights)

方法1:通过requests表识别重试调用

事件触发型Azure函数的重试调用,在requests表的customDimensions中会包含ExecutionContext_RetryCount字段,当该字段值大于0时,即为重试触发的调用。

对应的Kusto查询语句:

requests
| where cloud_RoleName == "你的函数应用名称"
| where customDimensions.ExecutionContext_RetryCount > 0
| project timestamp, name, customDimensions.ExecutionContext_RetryCount, resultCode, duration

方法2:结合traces表验证重试日志

部分函数运行时会在traces表中输出包含"Retry attempt"的日志信息,可通过关键字筛选辅助验证:

traces
| where cloud_RoleName == "你的函数应用名称"
| where message contains "Retry attempt"
| project timestamp, message, customDimensions.ExecutionContext_RetryCount

补充说明

  • 若ExecutionContext_RetryCount字段不存在,需确认函数运行时版本是否为v3及以上(该版本开始自动记录此字段)
  • 也可查看customDimensions中的TriggerReason字段,重试场景下通常会显示类似Retry due to exception的描述

内容的提问来源于stack exchange,提问作者iqoOopi

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.30 09:13:08