Application Insights 导出数据模型Application Insights Export Data Model

此表列出了从 Application Insights SDK 发送到门户的遥测属性。This table lists the properties of telemetry sent from the Application Insights SDKs to the portal. 连续导出的数据输出中会显示这些属性。You'll see these properties in data output from Continuous Export. 这些属性还显示在指标资源管理器诊断搜索的属性筛选器中。They also appear in property filters in Metric Explorer and Diagnostic Search.

需要注意的要点:Points to note:

  • 这些表中的 [0] 表示必须在其中插入索引的路径中的一个点,但它不一定总为 0。[0] in these tables denotes a point in the path where you have to insert an index; but it isn't always 0.
  • 持续时间的单位为微秒,因此 10000000 == 1 秒。Time durations are in tenths of a microsecond, so 10000000 == 1 second.
  • 日期和时间采用 UTC,以 ISO 格式 yyyy-MM-DDThh:mm:ss.sssZ 表示Dates and times are UTC, and are given in the ISO format yyyy-MM-DDThh:mm:ss.sssZ

示例Example

    // A server report about an HTTP request
    {
    "request": [
      {
        "urlData": { // derived from 'url'
          "host": "contoso.org",
          "base": "/",
          "hashTag": ""
        },
        "responseCode": 200, // Sent to client
        "success": true, // Default == responseCode<400
        // Request id becomes the operation id of child events
        "id": "fCOhCdCnZ9I=",  
        "name": "GET Home/Index",
        "count": 1, // 100% / sampling rate
        "durationMetric": {
          "value": 1046804.0, // 10000000 == 1 second
          // Currently the following fields are redundant:
          "count": 1.0,
          "min": 1046804.0,
          "max": 1046804.0,
          "stdDev": 0.0,
          "sampledValue": 1046804.0
        },
        "url": "/"
      }
    ],
    "internal": {
      "data": {
        "id": "7f156650-ef4c-11e5-8453-3f984b167d05",
        "documentVersion": "1.61"
      }
    },
    "context": {
      "device": { // client browser
        "type": "PC",
        "screenResolution": { },
        "roleInstance": "WFWEB14B.fabrikam.net"
      },
      "application": { },
      "location": { // derived from client ip
        "continent": "North China",
        "country": "China",
        // last octagon is anonymized to 0 at portal:
        "clientip": "168.62.177.0",
        "province": "",
        "city": ""
      },
      "data": {
        "isSynthetic": true, // we identified source as a bot
        // percentage of generated data sent to portal:
        "samplingRate": 100.0,
        "eventTime": "2016-03-21T10:05:45.7334717Z" // UTC
      },
      "user": {
        "isAuthenticated": false,
        "anonId": "us-tx-sn1-azr", // bot agent id
        "anonAcquisitionDate": "0001-01-01T00:00:00Z",
        "authAcquisitionDate": "0001-01-01T00:00:00Z",
        "accountAcquisitionDate": "0001-01-01T00:00:00Z"
      },
      "operation": {
        "id": "fCOhCdCnZ9I=",
        "parentId": "fCOhCdCnZ9I=",
        "name": "GET Home/Index"
      },
      "cloud": { },
      "serverDevice": { },
      "custom": { // set by custom fields of track calls
        "dimensions": [ ],
        "metrics": [ ]
      },
      "session": {
        "id": "65504c10-44a6-489e-b9dc-94184eb00d86",
        "isFirst": true
      }
    }
  }

上下文Context

所有类型的遥测随附上下文部分。All types of telemetry are accompanied by a context section. 并非所有字段都连同每个数据点传输。Not all of these fields are transmitted with every data point.

PathPath 类型Type 注释Notes
context.custom.dimensions [0]context.custom.dimensions [0] object [ ]object [ ] 自定义属性参数设置的键-值字符串对。Key-value string pairs set by custom properties parameter. 键的最大长度为 100,值的最大长度为 1024。Key max length 100, values max length 1024. 如果唯一值超过 100 个,属性可搜索,但不可用于分段。More than 100 unique values, the property can be searched but cannot be used for segmentation. 每个 ikey 最多有 200 个键。Max 200 keys per ikey.
context.custom.metrics [0]context.custom.metrics [0] object [ ]object [ ] 自定义测量参数和 TrackMetrics 设置的键-值对。Key-value pairs set by custom measurements parameter and by TrackMetrics. 键的最大长度为 100,值可以是数字。Key max length 100, values may be numeric.
context.data.eventTimecontext.data.eventTime stringstring UTCUTC
context.data.isSyntheticcontext.data.isSynthetic booleanboolean 请求似乎来自 Bot 或 Web 测试。Request appears to come from a bot or web test.
context.data.samplingRatecontext.data.samplingRate numbernumber SDK 生成的、发送到门户的遥测百分比。Percentage of telemetry generated by the SDK that is sent to portal. 范围为 0.0-100.0。Range 0.0-100.0.
context.devicecontext.device objectobject 客户端设备Client device
context.device.browsercontext.device.browser stringstring IE、Chrome...IE, Chrome, ...
context.device.browserVersioncontext.device.browserVersion stringstring Chrome 48.0...Chrome 48.0, ...
context.device.deviceModelcontext.device.deviceModel stringstring
context.device.deviceNamecontext.device.deviceName stringstring
context.device.idcontext.device.id stringstring
context.device.localecontext.device.locale stringstring en-GB、de-DE...en-GB, de-DE, ...
context.device.networkcontext.device.network stringstring
context.device.oemNamecontext.device.oemName stringstring
context.device.oscontext.device.os stringstring
context.device.osVersioncontext.device.osVersion stringstring 主机 OSHost OS
context.device.roleInstancecontext.device.roleInstance stringstring 服务器主机的 IDID of server host
context.device.roleNamecontext.device.roleName stringstring
context.device.screenResolutioncontext.device.screenResolution stringstring
context.device.typecontext.device.type stringstring 电脑、浏览器...PC, Browser, ...
context.locationcontext.location objectobject 派生自 clientipDerived from clientip.
context.location.citycontext.location.city stringstring 派生自 clientip(如果已知)Derived from clientip, if known
context.location.clientipcontext.location.clientip stringstring 最后一个八边形匿名化为 0。Last octagon is anonymized to 0.
context.location.continentcontext.location.continent stringstring
context.location.countrycontext.location.country stringstring
context.location.provincecontext.location.province stringstring 州或省State or province
context.operation.idcontext.operation.id stringstring 具有相同 operation id 的项在门户中显示为“相关项”。Items that have the same operation id are shown as Related Items in the portal. 通常是 request idUsually the request id.
context.operation.namecontext.operation.name stringstring URL 或请求名称url or request name
context.operation.parentIdcontext.operation.parentId stringstring 允许嵌套的相关项。Allows nested related items.
context.session.idcontext.session.id stringstring 一组来自相同源的操作的 IdId of a group of operations from the same source. 如果在 30 分钟期限内没有操作,则表示会话结束。A period of 30 minutes without an operation signals the end of a session.
context.session.isFirstcontext.session.isFirst booleanboolean
context.user.accountAcquisitionDatecontext.user.accountAcquisitionDate stringstring
context.user.accountIdcontext.user.accountId stringstring
context.user.anonAcquisitionDatecontext.user.anonAcquisitionDate stringstring
context.user.anonIdcontext.user.anonId stringstring
context.user.authAcquisitionDatecontext.user.authAcquisitionDate stringstring 经过身份验证的用户Authenticated User
context.user.authIdcontext.user.authId stringstring
context.user.isAuthenticatedcontext.user.isAuthenticated booleanboolean
context.user.storeRegioncontext.user.storeRegion stringstring
internal.data.documentVersioninternal.data.documentVersion stringstring
internal.data.idinternal.data.id stringstring 将项引入到 Application Insights 时分配的 Unique idUnique id that is assigned when an item is ingested to Application Insights

事件Events

TrackEvent() 生成的自定义事件。Custom events generated by TrackEvent().

PathPath 类型Type 注释Notes
event [0] countevent [0] count integerinteger 100/(采样率)。100/(sampling rate). 例如 4 => 25%。For example 4 => 25%.
event [0] nameevent [0] name stringstring 事件名称。Event name. 最大长度为 250。Max length 250.
event [0] urlevent [0] url stringstring
event [0] urlData.baseevent [0] urlData.base stringstring
event [0] urlData.hostevent [0] urlData.host stringstring

异常Exceptions

报告服务器和浏览器中发生的异常Reports exceptions in the server and in the browser.

PathPath 类型Type 注释Notes
basicException [0] assemblybasicException [0] assembly stringstring
basicException [0] countbasicException [0] count integerinteger 100/(采样率)。100/(sampling rate). 例如 4 => 25%。For example 4 => 25%.
basicException [0] exceptionGroupbasicException [0] exceptionGroup stringstring
basicException [0] exceptionTypebasicException [0] exceptionType stringstring
basicException [0] failedUserCodeMethodbasicException [0] failedUserCodeMethod stringstring
basicException [0] failedUserCodeAssemblybasicException [0] failedUserCodeAssembly stringstring
basicException [0] handledAtbasicException [0] handledAt stringstring
basicException [0] hasFullStackbasicException [0] hasFullStack booleanboolean
basicException [0] idbasicException [0] id stringstring
basicException [0] methodbasicException [0] method stringstring
basicException [0] messagebasicException [0] message stringstring 异常消息。Exception message. 最大长度为 10k。Max length 10k.
basicException [0] outerExceptionMessagebasicException [0] outerExceptionMessage stringstring
basicException [0] outerExceptionThrownAtAssemblybasicException [0] outerExceptionThrownAtAssembly stringstring
basicException [0] outerExceptionThrownAtMethodbasicException [0] outerExceptionThrownAtMethod stringstring
basicException [0] outerExceptionTypebasicException [0] outerExceptionType stringstring
basicException [0] outerIdbasicException [0] outerId stringstring
basicException [0] parsedStack [0] assemblybasicException [0] parsedStack [0] assembly stringstring
basicException [0] parsedStack [0] fileNamebasicException [0] parsedStack [0] fileName stringstring
basicException [0] parsedStack [0] levelbasicException [0] parsedStack [0] level integerinteger
basicException [0] parsedStack [0] linebasicException [0] parsedStack [0] line integerinteger
basicException [0] parsedStack [0] methodbasicException [0] parsedStack [0] method stringstring
basicException [0] stackbasicException [0] stack stringstring 最大长度为 10kMax length 10k
basicException [0] typeNamebasicException [0] typeName stringstring

跟踪消息Trace Messages

TrackTrace日志记录适配器发送。Sent by TrackTrace, and by the logging adapters.

PathPath 类型Type 注释Notes
message [0] loggerNamemessage [0] loggerName stringstring
message [0] parametersmessage [0] parameters stringstring
message [0] rawmessage [0] raw stringstring 日志消息,最大长度为 10k。The log message, max length 10k.
message [0] severityLevelmessage [0] severityLevel stringstring

远程依赖项Remote dependency

由 TrackDependency 发送。Sent by TrackDependency. 用于报告服务器中依赖项调用以及浏览器中 AJAX 调用的性能和用法。Used to report performance and usage of calls to dependencies in the server, and AJAX calls in the browser.

PathPath 类型Type 注释Notes
remoteDependency [0] asyncremoteDependency [0] async booleanboolean
remoteDependency [0] baseNameremoteDependency [0] baseName stringstring
remoteDependency [0] commandNameremoteDependency [0] commandName stringstring 例如“home/index”For example "home/index"
remoteDependency [0] countremoteDependency [0] count integerinteger 100/(采样率)。100/(sampling rate). 例如 4 => 25%。For example 4 => 25%.
remoteDependency [0] dependencyTypeNameremoteDependency [0] dependencyTypeName stringstring HTTP、SQL...HTTP, SQL, ...
remoteDependency [0] durationMetric.valueremoteDependency [0] durationMetric.value numbernumber 从依赖项调用到完成响应花费的时间Time from call to completion of response by dependency
remoteDependency [0] idremoteDependency [0] id stringstring
remoteDependency [0] nameremoteDependency [0] name stringstring URL。Url. 最大长度为 250。Max length 250.
remoteDependency [0] resultCoderemoteDependency [0] resultCode stringstring 源 HTTP 依赖项from HTTP dependency
remoteDependency [0] successremoteDependency [0] success booleanboolean
remoteDependency [0] typeremoteDependency [0] type stringstring Http、Sql...Http, Sql,...
remoteDependency [0] urlremoteDependency [0] url stringstring 最大长度为 2000Max length 2000
remoteDependency [0] urlData.baseremoteDependency [0] urlData.base stringstring 最大长度为 2000Max length 2000
remoteDependency [0] urlData.hashTagremoteDependency [0] urlData.hashTag stringstring
remoteDependency [0] urlData.hostremoteDependency [0] urlData.host stringstring 最大长度为 200Max length 200

请求Requests

TrackRequest 发送。Sent by TrackRequest. 标准模块使用此属性报告在服务器上测量的服务器响应时间。The standard modules use this to reports server response time, measured at the server.

PathPath 类型Type 注释Notes
request [0] countrequest [0] count integerinteger 100/(采样率)。100/(sampling rate). 例如:4 => 25%.For example: 4 => 25%.
request [0] durationMetric.valuerequest [0] durationMetric.value numbernumber 从请求到响应花费的时间。Time from request arriving to response. 1e7 == 1s1e7 == 1s
请求 {0} idrequest [0] id stringstring Operation id
request [0] namerequest [0] name stringstring GET/POST + URL 基。GET/POST + url base. 最大长度为 250Max length 250
request [0] responseCoderequest [0] responseCode integerinteger 发送到客户端的 HTTP 响应HTTP response sent to client
request [0] successrequest [0] success booleanboolean 默认值 == (responseCode < 400)Default == (responseCode < 400)
request [0] urlrequest [0] url stringstring 不包括主机Not including host
request [0] urlData.baserequest [0] urlData.base stringstring
request [0] urlData.hashTagrequest [0] urlData.hashTag stringstring
request [0] urlData.hostrequest [0] urlData.host stringstring

页面视图性能Page View Performance

由浏览器发送。Sent by the browser. 测量处理页面花费的时间,从用户发起请求算起,到显示完成(不包括异步 AJAX 调用)为止。Measures the time to process a page, from user initiating the request to display complete (excluding async AJAX calls).

上下文值显示客户端 OS 和浏览器版本。Context values show client OS and browser version.

PathPath 类型Type 注释Notes
clientPerformance [0] clientProcess.valueclientPerformance [0] clientProcess.value integerinteger 从接收 HTML 完成到显示页面花费的时间。Time from end of receiving the HTML to displaying the page.
clientPerformance [0] nameclientPerformance [0] name stringstring
clientPerformance [0] networkConnection.valueclientPerformance [0] networkConnection.value integerinteger 建立网络连接花费的时间。Time taken to establish a network connection.
clientPerformance [0] receiveRequest.valueclientPerformance [0] receiveRequest.value integerinteger 从发送请求结束到在回复中接收 HTML 所花费的时间。Time from end of sending the request to receiving the HTML in reply.
clientPerformance [0] sendRequest.valueclientPerformance [0] sendRequest.value integerinteger 发送 HTTP 请求花费的时间。Time from taken to send the HTTP request.
clientPerformance [0] total.valueclientPerformance [0] total.value integerinteger 从开始发送请求到显示页面花费的时间。Time from starting to send the request to displaying the page.
clientPerformance [0] urlclientPerformance [0] url stringstring 此请求的 URLURL of this request
clientPerformance [0] urlData.baseclientPerformance [0] urlData.base stringstring
clientPerformance [0] urlData.hashTagclientPerformance [0] urlData.hashTag stringstring
clientPerformance [0] urlData.hostclientPerformance [0] urlData.host stringstring
clientPerformance [0] urlData.protocolclientPerformance [0] urlData.protocol stringstring

页面视图Page Views

由 trackPageView() 或 stopTrackPage 发送Sent by trackPageView() or stopTrackPage

PathPath 类型Type 注释Notes
view [0] countview [0] count integerinteger 100/(采样率)。100/(sampling rate). 例如 4 => 25%。For example 4 => 25%.
view [0] durationMetric.valueview [0] durationMetric.value integerinteger 在 trackPageView() 中设置的,或者由 startTrackPage() - stopTrackPage() 设置的可选值。Value optionally set in trackPageView() or by startTrackPage() - stopTrackPage(). 与 clientPerformance 值不同。Not the same as clientPerformance values.
view [0] nameview [0] name stringstring 页面标题。Page title. 最大长度为 250Max length 250
view [0] urlview [0] url stringstring
view [0] urlData.baseview [0] urlData.base stringstring
view [0] urlData.hashTagview [0] urlData.hashTag stringstring
view [0] urlData.hostview [0] urlData.host stringstring

可用性Availability

报告可用性 Web 测试Reports availability web tests.

PathPath 类型Type 注释Notes
availability [0] availabilityMetric.nameavailability [0] availabilityMetric.name stringstring availabilityavailability
availability [0] availabilityMetric.valueavailability [0] availabilityMetric.value numbernumber 1.0 或 0.01.0 or 0.0
availability [0] countavailability [0] count integerinteger 100/(采样率)。100/(sampling rate). 例如 4 => 25%。For example 4 => 25%.
availability [0] dataSizeMetric.nameavailability [0] dataSizeMetric.name stringstring
availability [0] dataSizeMetric.valueavailability [0] dataSizeMetric.value integerinteger
availability [0] durationMetric.nameavailability [0] durationMetric.name stringstring
availability [0] durationMetric.valueavailability [0] durationMetric.value numbernumber 测试持续时间。Duration of test. 1e7==1s1e7==1s
availability [0] messageavailability [0] message stringstring 故障诊断Failure diagnostic
availability [0] resultavailability [0] result stringstring 通过/失败Pass/Fail
availability [0] runLocationavailability [0] runLocation stringstring http 请求的地域源Geo source of http req
availability [0] testNameavailability [0] testName stringstring
availability [0] testRunIdavailability [0] testRunId stringstring
availability [0] testTimestampavailability [0] testTimestamp stringstring

指标Metrics

由 TrackMetric() 生成。Generated by TrackMetric().

指标值出现在 context.custom.metrics[0] 中The metric value is found in context.custom.metrics[0]

例如:For example:

{
  "metric": [ ],
  "context": {
  ...
    "custom": {
      "dimensions": [
        { "ProcessId": "4068" }
      ],
      "metrics": [
        {
          "dispatchRate": {
            "value": 0.001295,
            "count": 1.0,
            "min": 0.001295,
            "max": 0.001295,
            "stdDev": 0.0,
            "sampledValue": 0.001295,
            "sum": 0.001295
          }
        }
      ]  
    }
  }
}

关于指标值About metric values

指标报告和其他位置中的指标值是使用标准对象结构报告的。Metric values, both in metric reports and elsewhere, are reported with a standard object structure. 例如:For example:

"durationMetric": {
  "name": "contoso.org",
  "type": "Aggregation",
  "value": 468.71603053650279,
  "count": 1.0,
  "min": 468.71603053650279,
  "max": 468.71603053650279,
  "stdDev": 0.0,
  "sampledValue": 468.71603053650279
}

目前(将来可能会变化)在所有通过标准 SDK 模块报告的值中,只有 count==1 以及 namevalue 字段有用。Currently - though this might change in the future - in all values reported from the standard SDK modules, count==1 and only the name and value fields are useful. 这些元素存在差异的唯一情况是你编写自己的 TrackMetric 调用,并在其中设置其他参数。The only case where they would be different would be if you write your own TrackMetric calls in which you set the other parameters.

其他字段的用途是便于在 SDK 中聚合指标,减少门户接收的流量。The purpose of the other fields is to allow metrics to be aggregated in the SDK, to reduce traffic to the portal. 例如,在发送每份指标报告之前,可求多个连续读数的平均值。For example, you could average several successive readings before sending each metric report. 然后计算最小值、最大值、标准偏差和聚合值(总和或平均值),并将计数设置为报告呈现的读数数目。Then you would calculate the min, max, standard deviation and aggregate value (sum or average) and set count to the number of readings represented by the report.

上表中省略了一些极少用到的字段:count、min、max、stdDev 和 sampledValue。In the tables above, we have omitted the rarely used fields count, min, max, stdDev, and sampledValue.

如果需要减少遥测量,可以改用采样,而不要使用预先聚合的指标。Instead of pre-aggregating metrics, you can use sampling if you need to reduce the volume of telemetry.

持续时间Durations

除非另有规定,否则持续时间以十分之一微秒表示,因此 10000000.0 表示 1 秒。Except where otherwise noted, durations are represented in tenths of a microsecond, so that 10000000.0 means 1 second.

另请参阅See also