Events - Get
获取事件
获取单个事件的数据
GET https://api.applicationinsights.io/v1/apps/{appId}/events/{eventType}/{eventId}
GET https://api.applicationinsights.io/v1/apps/{appId}/events/{eventType}/{eventId}?timespan={timespan}
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
app
|
path | True |
string |
应用程序的 ID。 这是 Azure 门户中“API 访问设置”边栏选项卡中的应用程序 ID。 |
|
event
|
path | True |
string |
事件的 ID。 |
|
event
|
path | True |
要查询的事件的类型;标准事件类型( |
|
|
timespan
|
query |
string |
自选。 要检索事件的时间跨度。 这是ISO8601时间段值。 除了 Odata 表达式中指定的任何时间跨度外,还会应用此时间跨度。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
成功的响应 |
|
| Other Status Codes |
错误响应对象。 |
安全性
oauth2
连接到 Azure Application Insights API
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize?resource=https%3A%2F%2Fapi.applicationinsights.io
作用域
| 名称 | 说明 |
|---|---|
| user_impersonation | 模拟用户帐户 |
示例
eventById
示例请求
GET https://api.applicationinsights.io/v1/apps/DEMO_APP/events/traces/dc76df01-0141-11e8-9894-e3e7c1eeabad
示例响应
{
"@odata.context": "https://api.applicationinsights.io/v1/apps/DEMO_APP/events/traces/$metadata#traces",
"value": [
{
"id": "dc76df01-0141-11e8-9894-e3e7c1eeabad",
"type": "trace",
"count": 1,
"timestamp": "2018-01-24T20:04:32.243Z",
"customDimensions": null,
"customMeasurements": null,
"operation": {
"name": "GET /FabrikamProd/Employees/Create",
"id": "HPFy1bNlyQ0=",
"parentId": "|HPFy1bNlyQ0=.c642e1f1_",
"syntheticSource": "Application Insights Availability Monitoring"
},
"session": {
"id": "97915c9e-2ba3-4258-82f5-84233de21127"
},
"user": {
"id": "emea-ru-msa-edge_97915c9e-2ba3-4258-82f5-84233de21127",
"accountId": null,
"authenticatedId": null
},
"cloud": {
"roleName": null,
"roleInstance": "AIConnect2"
},
"ai": {
"iKey": "5a2e4e0c-e136-4a15-9824-90ba859b0a89",
"appName": "fabrikamprod",
"appId": "cf58dcfd-0683-487c-bc84-048789bca8e5",
"sdkVersion": "sd:2.4.1-442"
},
"trace": {
"message": "New Request Received",
"severityLevel": 0
},
"application": {
"version": null
},
"client": {
"model": null,
"os": null,
"type": "PC",
"browser": null,
"ip": "51.140.105.0",
"city": "London",
"stateOrProvince": "England",
"countryOrRegion": "United Kingdom"
}
}
]
}
定义
CustomDimensions
事件的自定义维度
| 名称 | 类型 | 说明 |
|---|---|---|
| additionalProperties |
object |
CustomMeasurements
事件的自定义度量
| 名称 | 类型 | 说明 |
|---|---|---|
| additionalProperties |
object |
errorDetail
错误详细信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| additionalProperties |
object |
|
| code |
string |
错误的代码。 |
| message |
string |
人工可读错误消息。 |
| resources |
string[] |
指示对错误负责的资源。 |
| target |
string |
指示请求中的哪个属性负责错误。 |
| value |
string |
指示“target”中的哪个值负责错误。 |
errorInfo
错误的代码和消息。
| 名称 | 类型 | 说明 |
|---|---|---|
| additionalProperties |
object |
|
| code |
string |
计算机可读错误代码。 |
| details |
错误详细信息。 |
|
| innererror |
错误的代码和消息。 |
|
| message |
string |
人工可读错误消息。 |
errorResponse
错误详细信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| error |
错误的代码和消息。 |
eventsAiInfo
事件结果的 AI 相关应用程序信息
| 名称 | 类型 | 说明 |
|---|---|---|
| appId |
string |
应用程序的 ID |
| appName |
string |
应用程序的名称 |
| iKey |
string |
应用的 iKey |
| sdkVersion |
string |
应用程序的 SDK 版本 |
eventsApplicationInfo
事件结果的应用程序信息
| 名称 | 类型 | 说明 |
|---|---|---|
| version |
string |
应用程序的版本 |
eventsAvailabilityResultInfo
可用性结果信息
| 名称 | 类型 | 说明 |
|---|---|---|
| duration |
integer (int64) |
可用性结果的持续时间 |
| id |
string |
可用性结果的 ID |
| location |
string |
可用性结果的位置 |
| message |
string |
可用性结果的消息 |
| name |
string |
可用性结果的名称 |
| performanceBucket |
string |
可用性结果的性能存储桶 |
| size |
string |
可用性结果的大小 |
| success |
string |
指示可用性结果是否成功 |
eventsAvailabilityResultResult
可用性结果
| 名称 | 类型 | 说明 |
|---|---|---|
| ai |
事件的 AI 信息 |
|
| application |
事件的应用程序信息 |
|
| availabilityResult |
可用性结果信息 |
|
| client |
事件的客户端信息 |
|
| cloud |
事件的云信息 |
|
| count |
integer (int64) |
事件的计数 |
| customDimensions |
事件的自定义维度 |
|
| customMeasurements |
事件的自定义度量 |
|
| id |
string |
此事件的唯一 ID。 |
| operation |
事件的作信息 |
|
| session |
事件的会话信息 |
|
| timestamp |
string (date-time) |
事件的时间戳 |
| type |
string:
availability |
事件的类型。 |
| user |
事件的用户信息 |
eventsBrowserTimingInfo
浏览器计时信息
| 名称 | 类型 | 说明 |
|---|---|---|
| name |
string |
页面的名称 |
| networkDuration |
integer (int64) |
负载的网络持续时间 |
| performanceBucket |
string |
负载的性能存储桶 |
| processingDuration |
integer (int64) |
加载的处理持续时间 |
| receiveDuration |
integer (int64) |
加载的接收持续时间 |
| sendDuration |
integer (int64) |
加载的发送持续时间 |
| totalDuration |
integer (int64) |
负载的总持续时间 |
| url |
string |
页面的 URL |
| urlHost |
string |
URL 的主机 |
| urlPath |
string |
URL 的路径 |
eventsBrowserTimingResult
浏览器计时结果
| 名称 | 类型 | 说明 |
|---|---|---|
| ai |
事件的 AI 信息 |
|
| application |
事件的应用程序信息 |
|
| browserTiming |
浏览器计时信息 |
|
| client |
事件的客户端信息 |
|
| clientPerformance |
客户端性能信息 |
|
| cloud |
事件的云信息 |
|
| count |
integer (int64) |
事件的计数 |
| customDimensions |
事件的自定义维度 |
|
| customMeasurements |
事件的自定义度量 |
|
| id |
string |
此事件的唯一 ID。 |
| operation |
事件的作信息 |
|
| session |
事件的会话信息 |
|
| timestamp |
string (date-time) |
事件的时间戳 |
| type |
string:
browser |
事件的类型。 |
| user |
事件的用户信息 |
eventsClientInfo
事件结果的客户端信息
| 名称 | 类型 | 说明 |
|---|---|---|
| browser |
string |
客户端的浏览器 |
| city |
string |
客户城市 |
| countryOrRegion |
string |
客户端的国家或地区 |
| ip |
string |
客户端的 IP 地址 |
| model |
string |
客户端模型 |
| os |
string |
客户端的作系统 |
| stateOrProvince |
string |
客户端的状态或省 |
| type |
string |
客户端的类型 |
eventsClientPerformanceInfo
客户端性能信息
| 名称 | 类型 | 说明 |
|---|---|---|
| name |
string |
客户端性能的名称 |
eventsCloudInfo
事件结果的云信息
| 名称 | 类型 | 说明 |
|---|---|---|
| roleInstance |
string |
云的角色实例 |
| roleName |
string |
云的角色名称 |
eventsCustomEventInfo
自定义事件信息
| 名称 | 类型 | 说明 |
|---|---|---|
| name |
string |
自定义事件的名称 |
eventsCustomEventResult
自定义事件结果
| 名称 | 类型 | 说明 |
|---|---|---|
| ai |
事件的 AI 信息 |
|
| application |
事件的应用程序信息 |
|
| client |
事件的客户端信息 |
|
| cloud |
事件的云信息 |
|
| count |
integer (int64) |
事件的计数 |
| customDimensions |
事件的自定义维度 |
|
| customEvent |
自定义事件信息 |
|
| customMeasurements |
事件的自定义度量 |
|
| id |
string |
此事件的唯一 ID。 |
| operation |
事件的作信息 |
|
| session |
事件的会话信息 |
|
| timestamp |
string (date-time) |
事件的时间戳 |
| type |
string:
custom |
事件的类型。 |
| user |
事件的用户信息 |
eventsCustomMetricInfo
自定义指标信息
| 名称 | 类型 | 说明 |
|---|---|---|
| name |
string |
自定义指标的名称 |
| value |
number (double) |
自定义指标的值 |
| valueCount |
integer (int32) |
自定义指标的计数 |
| valueMax |
number (double) |
自定义指标的最大值 |
| valueMin |
number (double) |
自定义指标的最小值 |
| valueStdDev |
number (double) |
自定义指标的标准偏差 |
| valueSum |
number (double) |
自定义指标的总和 |
eventsCustomMetricResult
自定义指标结果
| 名称 | 类型 | 说明 |
|---|---|---|
| ai |
事件的 AI 信息 |
|
| application |
事件的应用程序信息 |
|
| client |
事件的客户端信息 |
|
| cloud |
事件的云信息 |
|
| count |
integer (int64) |
事件的计数 |
| customDimensions |
事件的自定义维度 |
|
| customMeasurements |
事件的自定义度量 |
|
| customMetric |
自定义指标信息 |
|
| id |
string |
此事件的唯一 ID。 |
| operation |
事件的作信息 |
|
| session |
事件的会话信息 |
|
| timestamp |
string (date-time) |
事件的时间戳 |
| type |
string:
custom |
事件的类型。 |
| user |
事件的用户信息 |
eventsDependencyInfo
依赖项信息
| 名称 | 类型 | 说明 |
|---|---|---|
| data |
string |
依赖项的数据 |
| duration |
integer (int64) |
依赖项的持续时间 |
| id |
string |
依赖项的 ID |
| name |
string |
依赖项的名称 |
| performanceBucket |
string |
依赖项的性能存储桶 |
| resultCode |
string |
依赖项的结果代码 |
| success |
string |
指示依赖项是否成功 |
| target |
string |
依赖项的目标 |
| type |
string |
依赖项的类型 |
eventsDependencyResult
依赖项结果
| 名称 | 类型 | 说明 |
|---|---|---|
| ai |
事件的 AI 信息 |
|
| application |
事件的应用程序信息 |
|
| client |
事件的客户端信息 |
|
| cloud |
事件的云信息 |
|
| count |
integer (int64) |
事件的计数 |
| customDimensions |
事件的自定义维度 |
|
| customMeasurements |
事件的自定义度量 |
|
| dependency |
依赖项信息 |
|
| id |
string |
此事件的唯一 ID。 |
| operation |
事件的作信息 |
|
| session |
事件的会话信息 |
|
| timestamp |
string (date-time) |
事件的时间戳 |
| type |
string:
dependency |
事件的类型。 |
| user |
事件的用户信息 |
eventsExceptionDetail
异常详细信息
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string |
异常详细信息的 ID |
| message |
string |
异常详细信息的消息 |
| outerId |
string |
异常详细信息的外部 ID |
| parsedStack |
已分析的堆栈 |
|
| severityLevel |
string |
异常详细信息的严重性级别 |
| type |
string |
异常详细信息的类型 |
eventsExceptionDetailsParsedStack
已分析的堆栈条目
| 名称 | 类型 | 说明 |
|---|---|---|
| assembly |
string |
堆栈项的程序集 |
| level |
integer (int64) |
堆栈条目的级别 |
| line |
integer (int64) |
堆栈条目的行 |
| method |
string |
堆栈条目的方法 |
eventsExceptionInfo
异常信息
| 名称 | 类型 | 说明 |
|---|---|---|
| assembly |
string |
引发异常的程序集 |
| details |
异常的详细信息 |
|
| handledAt |
string |
指示在以下位置处理异常的位置 |
| innermostAssembly |
string |
异常的内部大多数程序集 |
| innermostMessage |
string |
异常的最内部消息 |
| innermostMethod |
string |
异常的最内部方法 |
| innermostType |
string |
异常的最内部类型 |
| message |
string |
异常的消息 |
| method |
string |
引发异常的方法 |
| outerAssembly |
string |
异常的外部程序集 |
| outerMessage |
string |
异常的外部消息 |
| outerMethod |
string |
异常的外部方法 |
| outerType |
string |
异常的外部类型 |
| problemId |
string |
异常的问题 ID |
| severityLevel |
integer |
异常的严重性级别 |
| type |
string |
异常的类型 |
eventsExceptionResult
异常结果
| 名称 | 类型 | 说明 |
|---|---|---|
| ai |
事件的 AI 信息 |
|
| application |
事件的应用程序信息 |
|
| client |
事件的客户端信息 |
|
| cloud |
事件的云信息 |
|
| count |
integer (int64) |
事件的计数 |
| customDimensions |
事件的自定义维度 |
|
| customMeasurements |
事件的自定义度量 |
|
| exception |
异常信息 |
|
| id |
string |
此事件的唯一 ID。 |
| operation |
事件的作信息 |
|
| session |
事件的会话信息 |
|
| timestamp |
string (date-time) |
事件的时间戳 |
| type |
string:
exception |
事件的类型。 |
| user |
事件的用户信息 |
eventsOperationInfo
事件结果的作信息
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string |
作的 ID |
| name |
string |
作的名称 |
| parentId |
string |
作的父 ID |
| syntheticSource |
string |
作的合成源 |
eventsPageViewInfo
页面视图信息
| 名称 | 类型 | 说明 |
|---|---|---|
| duration |
string |
页面视图的持续时间 |
| name |
string |
页面的名称 |
| performanceBucket |
string |
页面视图的性能存储桶 |
| url |
string |
页面的 URL |
eventsPageViewResult
页面视图结果
| 名称 | 类型 | 说明 |
|---|---|---|
| ai |
事件的 AI 信息 |
|
| application |
事件的应用程序信息 |
|
| client |
事件的客户端信息 |
|
| cloud |
事件的云信息 |
|
| count |
integer (int64) |
事件的计数 |
| customDimensions |
事件的自定义维度 |
|
| customMeasurements |
事件的自定义度量 |
|
| id |
string |
此事件的唯一 ID。 |
| operation |
事件的作信息 |
|
| pageView |
页面视图信息 |
|
| session |
事件的会话信息 |
|
| timestamp |
string (date-time) |
事件的时间戳 |
| type |
string:
page |
事件的类型。 |
| user |
事件的用户信息 |
eventsPerformanceCounterInfo
性能计数器信息
| 名称 | 类型 | 说明 |
|---|---|---|
| category |
string |
性能计数器的类别 |
| counter |
string |
性能计数器的计数器 |
| instance |
string |
性能计数器的实例 |
| instanceName |
string |
性能计数器的实例名称 |
| name |
string |
性能计数器的名称 |
| value |
number (double) |
性能计数器的值 |
eventsPerformanceCounterResult
性能计数器结果
| 名称 | 类型 | 说明 |
|---|---|---|
| ai |
事件的 AI 信息 |
|
| application |
事件的应用程序信息 |
|
| client |
事件的客户端信息 |
|
| cloud |
事件的云信息 |
|
| count |
integer (int64) |
事件的计数 |
| customDimensions |
事件的自定义维度 |
|
| customMeasurements |
事件的自定义度量 |
|
| id |
string |
此事件的唯一 ID。 |
| operation |
事件的作信息 |
|
| performanceCounter |
性能计数器信息 |
|
| session |
事件的会话信息 |
|
| timestamp |
string (date-time) |
事件的时间戳 |
| type |
string:
performance |
事件的类型。 |
| user |
事件的用户信息 |
eventsRequestInfo
请求信息
| 名称 | 类型 | 说明 |
|---|---|---|
| duration |
number (double) |
请求的持续时间 |
| id |
string |
请求的 ID |
| name |
string |
请求的名称 |
| performanceBucket |
string |
请求的性能存储桶 |
| resultCode |
string |
请求的结果代码 |
| source |
string |
请求的源 |
| success |
string |
指示请求是否成功 |
| url |
string |
请求的 URL |
eventsRequestResult
请求结果
| 名称 | 类型 | 说明 |
|---|---|---|
| ai |
事件的 AI 信息 |
|
| application |
事件的应用程序信息 |
|
| client |
事件的客户端信息 |
|
| cloud |
事件的云信息 |
|
| count |
integer (int64) |
事件的计数 |
| customDimensions |
事件的自定义维度 |
|
| customMeasurements |
事件的自定义度量 |
|
| id |
string |
此事件的唯一 ID。 |
| operation |
事件的作信息 |
|
| request |
请求信息 |
|
| session |
事件的会话信息 |
|
| timestamp |
string (date-time) |
事件的时间戳 |
| type |
string:
request |
事件的类型。 |
| user |
事件的用户信息 |
eventsResults
事件查询结果。
| 名称 | 类型 | 说明 |
|---|---|---|
| @ai.messages |
此响应的 OData 消息。 |
|
| @odata.context |
string |
此响应的 OData 上下文元数据终结点 |
| value | eventsResultData[]: |
事件查询结果的内容。 |
eventsSessionInfo
事件结果的会话信息
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string |
会话的 ID |
eventsTraceInfo
跟踪信息
| 名称 | 类型 | 说明 |
|---|---|---|
| message |
string |
跟踪消息 |
| severityLevel |
integer |
跟踪严重性级别 |
eventsTraceResult
跟踪结果
| 名称 | 类型 | 说明 |
|---|---|---|
| ai |
事件的 AI 信息 |
|
| application |
事件的应用程序信息 |
|
| client |
事件的客户端信息 |
|
| cloud |
事件的云信息 |
|
| count |
integer (int64) |
事件的计数 |
| customDimensions |
事件的自定义维度 |
|
| customMeasurements |
事件的自定义度量 |
|
| id |
string |
此事件的唯一 ID。 |
| operation |
事件的作信息 |
|
| session |
事件的会话信息 |
|
| timestamp |
string (date-time) |
事件的时间戳 |
| trace |
跟踪信息 |
|
| type |
string:
trace |
事件的类型。 |
| user |
事件的用户信息 |
eventsUserInfo
事件结果的用户信息
| 名称 | 类型 | 说明 |
|---|---|---|
| accountId |
string |
用户的帐户 ID |
| authenticatedId |
string |
用户经过身份验证的 ID |
| id |
string |
用户的 ID |
EventType
要查询的事件的类型;标准事件类型(traces、customEvents、pageViews、requests、dependencies、exceptions、availabilityResults)或 $all 跨所有事件类型进行查询。
| 值 | 说明 |
|---|---|
| $all | |
| traces | |
| customEvents | |
| pageViews | |
| browserTimings | |
| requests | |
| dependencies | |
| exceptions | |
| availabilityResults | |
| performanceCounters | |
| customMetrics |