You need to enable JavaScript to run this app. Application Insights REST API查询始终返回空行问题求助
优惠活动
大模型
产品
解决方案
定价
更多

Application Insights REST API查询始终返回空行问题求助

App Insights API 查询始终返回空行问题排查

我使用App Insights的查询API获取数据,但始终返回空行,即"rows": []。

响应示例如下:

{
  "tables": [
    {
      "name": "PrimaryResult",
      "columns": [
        {
          "name": "timestamp",
          "type": "datetime"
        },
        {
          "name": "message",
          "type": "string"
        },
        {
          "name": "severityLevel",
          "type": "int"
        },
        ...
        {
          "name": "_ResourceId",
          "type": "string"
        }
      ],
      "rows": []
    }
  ]
}

我通过Nightingale工具发起请求,参数详情如下:

请求方法 - POST
请求地址 - https://api.applicationinsights.io/v1/apps/00000000-0000-0000-0000-000000000000/query
请求体 - {
    "query": "traces | where timestamp <= ago(120m) | limit 10"
}
请求头 - {"X-Api-Key": "0000000000000000000000000000000000000000"}

我已经尝试过以下多种方式,但接口始终返回200状态码和空结果:

  • 修改查询语句
  • 添加timespan参数
  • 改用GET请求方法
  • 添加Content-Type或charset请求头
  • 切换为OAuth 2.0认证方式查询(操作截图如下)

OAuth认证配置截图1
OAuth认证配置截图2
OAuth认证配置截图3

想排查是否遗漏了某些必要配置。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.30 17:39:24