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

ApplicationInsights V3 Java无代码Telemetry Processor的Include规则失效

问题

需要为所有包含属性toto且值为valuetoto的日志添加新属性opfacility,但配置后未生效。使用Application Insights Agent 3.4.15.jar,配置Telemetry Processor后出现以下现象:

  • 移除Include规则时,处理器可正常添加属性
  • 添加Include规则后失效
  • 事务搜索结果中已确认存在toto=valuetoto的自定义属性,但目标属性opfacility未被添加

当前配置JSON如下:

{
  "connectionString": "secret",
  "role": {
    "name": "dev"
  },
  "preview": {
    "processors": [
      {
        "type": "attribute",
        "include": {
          "matchType": "strict",
          "attributes": [
            {
              "key": "toto",
              "value": "valuetoto"
            }
          ]
        },
        "actions": [
          {
            "key": "opfacility",
            "value": "opcpf",
            "action": "insert"
          }
        ]
      }
    ]
  }
}
分析与解决

问题出在include规则的格式错误:

  • Application Insights Agent的strict匹配类型要求直接将目标属性的键值对定义在include节点下,而非嵌套在attributes数组中,你的配置写法不符合处理器的预期解析逻辑

修正后的配置如下:

{
  "connectionString": "secret",
  "role": {
    "name": "dev"
  },
  "preview": {
    "processors": [
      {
        "type": "attribute",
        "include": {
          "matchType": "strict",
          "toto": "valuetoto"
        },
        "actions": [
          {
            "key": "opfacility",
            "value": "opcpf",
            "action": "insert"
          }
        ]
      }
    ]
  }
}

额外验证提示:

  • 确认toto属性是在Telemetry Processor执行阶段就已存在,避免部分自定义属性在处理器之后才被添加导致匹配失效
  • 重启Application Insights Agent加载新配置,避免旧配置缓存影响

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.12 19:07:45