Metadata - Get
获取元数据信息
检索应用的元数据信息,包括其架构等。
GET https://api.applicationinsights.io/v1/apps/{appId}/metadata
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
app
|
path | True |
string |
应用程序的 ID。 这是 Azure 门户中“API 访问设置”边栏选项卡中的应用程序 ID。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 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 | 模拟用户帐户 |
示例
metadataGet
示例请求
GET https://api.applicationinsights.io/v1/apps/cf58dcfd-0683-487c-bc84-048789bca8e5/metadata
示例响应
{
"tables": [
{
"id": "t/requests",
"name": "requests",
"timespanColumn": "timestamp",
"columns": [
{
"name": "timestamp",
"type": "datetime"
},
{
"name": "id",
"type": "string"
},
{
"name": "source",
"type": "string"
},
{
"name": "name",
"type": "string",
"isPreferredFacet": true
},
{
"name": "url",
"type": "string",
"isPreferredFacet": true
},
{
"name": "success",
"type": "string",
"isPreferredFacet": true
},
{
"name": "resultCode",
"type": "string",
"isPreferredFacet": true
},
{
"name": "duration",
"type": "real"
},
{
"name": "performanceBucket",
"type": "string",
"isPreferredFacet": true
},
{
"name": "itemType",
"type": "string"
},
{
"name": "customDimensions",
"type": "dynamic",
"isPreferredFacet": true
},
{
"name": "customMeasurements",
"type": "dynamic"
},
{
"name": "operation_Name",
"type": "string",
"isPreferredFacet": true
},
{
"name": "operation_Id",
"type": "string"
},
{
"name": "operation_ParentId",
"type": "string"
},
{
"name": "operation_SyntheticSource",
"type": "string"
},
{
"name": "session_Id",
"type": "string"
},
{
"name": "user_Id",
"type": "string"
},
{
"name": "user_AuthenticatedId",
"type": "string"
},
{
"name": "user_AccountId",
"type": "string"
},
{
"name": "application_Version",
"type": "string",
"isPreferredFacet": true
},
{
"name": "client_Type",
"type": "string"
},
{
"name": "client_Model",
"type": "string"
},
{
"name": "client_OS",
"type": "string"
},
{
"name": "client_IP",
"type": "string"
},
{
"name": "client_City",
"type": "string"
},
{
"name": "client_StateOrProvince",
"type": "string"
},
{
"name": "client_CountryOrRegion",
"type": "string"
},
{
"name": "client_Browser",
"type": "string",
"isPreferredFacet": true
},
{
"name": "cloud_RoleName",
"type": "string",
"isPreferredFacet": true
},
{
"name": "cloud_RoleInstance",
"type": "string",
"isPreferredFacet": true
},
{
"name": "appId",
"type": "string"
},
{
"name": "appName",
"type": "string"
},
{
"name": "iKey",
"type": "string"
},
{
"name": "sdkVersion",
"type": "string"
},
{
"name": "itemId",
"type": "string"
},
{
"name": "itemCount",
"type": "int"
}
]
}
],
"tableGroups": [
{
"id": "ai/StandardSchema",
"name": "StandardSchema",
"source": "ai",
"tables": [
"t/requests"
]
}
],
"applications": [
{
"id": "cf58dcfd-0683-487c-bc84-048789bca8e5",
"name": "FabrikamProd",
"resourceId": "/subscriptions/72993b69-db12-44fc-9a66-9c2005c30513/resourceGroups/Fabrikam/providers/microsoft.insights/components/FabrikamProd",
"tables": [],
"region": "southcentralus",
"tableGroups": [
"ai/StandardSchema"
]
}
]
}
定义
| 名称 | 说明 |
|---|---|
| Columns |
表上定义的列列表 |
|
error |
错误详细信息。 |
|
error |
错误的代码和消息。 |
|
error |
错误详细信息。 |
|
metadata |
Application Insights 应用程序。 |
|
Metadata |
列的数据类型 |
|
metadata |
存储的函数。 |
|
metadata |
元数据响应。 |
|
metadata |
参与 Application Insights 应用的架构的数据表。 |
|
metadata |
一组表。 |
Columns
表上定义的列列表
| 名称 | 类型 | 说明 |
|---|---|---|
| description |
string |
列的说明 |
| isPreferredFacet |
boolean |
指示此列是首选 Facet 的标志 |
| name |
string |
列的名称 |
| source |
object |
指示列的源,仅在多个应用具有列的冲突定义时才使用 |
| type |
列的数据类型 |
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 |
错误的代码和消息。 |
metadataApplication
Application Insights 应用程序。
| 名称 | 类型 | 说明 |
|---|---|---|
| functions |
string[] |
Application Insights 应用上存储的函数列表 |
| id |
string |
Application Insights 应用的 ID。 |
| name |
string |
Application Insights 应用的名称。 |
| region |
string |
Application Insights 应用的 Azure 区域。 |
| resourceId |
string |
Application Insights 应用的 ARM 资源 ID。 |
| tableGroups |
string[] |
Application Insights 应用上的表组列表 |
| tables |
string[] |
Application Insights 应用的自定义表列表。 |
MetadataColumnDataType
列的数据类型
| 值 | 说明 |
|---|---|
| bool | |
| datetime | |
| dynamic | |
| int | |
| long | |
| real | |
| string |
metadataFunction
存储的函数。
| 名称 | 类型 | 说明 |
|---|---|---|
| body |
string |
函数的 KQL 正文。 |
| description |
string |
函数的说明。 |
| displayName |
string |
函数的显示名称。 |
| id |
string |
函数的 ID。 |
| name |
string |
要用于查询的函数的名称。 |
| parameters |
string |
函数的参数/参数(如果有)。 |
metadataResults
元数据响应。
| 名称 | 类型 | 说明 |
|---|---|---|
| applications |
元数据请求中引用的 Application Insights 应用列表。 |
|
| functions |
存储在应用上的函数列表。 |
|
| tableGroups |
应用上表组的列表。 |
|
| tables |
构成应用的架构的表和列的列表。 |
metadataTable
参与 Application Insights 应用的架构的数据表。
| 名称 | 类型 | 说明 |
|---|---|---|
| columns |
Columns[] |
表上定义的列列表 |
| description |
string |
表的说明 |
| id |
string |
表的 ID |
| name |
string |
表的名称 |
| timespanColumn |
string |
与表的 timespan 查询参数关联的列 |
metadataTableGroup
一组表。
| 名称 | 类型 | 说明 |
|---|---|---|
| description |
string |
表组的说明 |
| displayName |
string |
表组的显示名称 |
| id |
string |
表组的 ID |
| name |
string |
表组的名称 |
| source |
string |
表组的源可以是 LOG Analytics 工作区的 AI 或 OMS |
| tables |
string[] |
表组中包含的表列表 |