Microsoft Azure Application Insights Client

Microsoft Azure Application Insights Client is a software development kit (SDK) that allows developers to monitor and track the performance of their applications running on the Azure cloud platform. The client collects and analyzes telemetry data, such as performance metrics, error logs, and user interactions, to provide insights into the application's health and usage.

OpenAPI Specification

applicationinsightsclient-openapi-original.yml Raw ↑
swagger: '2.0'
info:
  version: 2020-09-15_Preview
  title: Microsoft Azure ApplicationInsightsClient
  description: >-
    This document describes the protocol for client requests and responses to
    the data collection endpoint.
x-ms-parameterized-host:
  hostTemplate: '{Host}/v2'
  useSchemePrefix: false
  parameters:
    - $ref: '#/parameters/Host'
paths:
  /track:
    post:
      summary: Microsoft Azure Track Telemetry Events
      description: >-
        This operation sends a sequence of telemetry events that will be
        monitored by Azure Monitor.
      operationId: microsoftAzureTrack
      parameters:
        - name: body
          in: body
          description: The list of telemetry events to track.
          required: true
          schema:
            type: array
            items:
              $ref: '#/definitions/TelemetryEnvelope'
      consumes:
        - application/json
        - x-json-stream
      produces:
        - application/json
      responses:
        '200':
          description: All of the telemetry items were accepted and processed.
          schema:
            $ref: '#/definitions/TrackResponse'
        '206':
          description: >-
            Partial success. Some of the telemetry items were accepted and
            processed.
          schema:
            $ref: '#/definitions/TrackResponse'
        '400':
          description: Bad Request
          x-ms-error-response: true
          schema:
            $ref: '#/definitions/TrackResponse'
        '402':
          description: Payment Required
          x-ms-error-response: true
          schema:
            $ref: '#/definitions/TrackResponse'
        '429':
          description: Too Many Requests
          x-ms-error-response: true
          schema:
            $ref: '#/definitions/TrackResponse'
        '500':
          description: Internal Server Error
          x-ms-error-response: true
          schema:
            $ref: '#/definitions/TrackResponse'
        '503':
          description: Service Unavailable
          x-ms-error-response: true
          schema:
            $ref: '#/definitions/TrackResponse'
      x-ms-examples:
        Track examples:
          $ref: examples/track.json
      tags:
        - Track
definitions:
  AvailabilityData:
    allOf:
      - $ref: '#/definitions/Domain'
      - type: object
        description: >-
          Instances of AvailabilityData represent the result of executing an
          availability test.
        required:
          - id
          - name
          - duration
          - success
        properties:
          id:
            type: string
            description: >-
              Identifier of a test run. Use it to correlate steps of test run
              and telemetry generated by the service.
            maxLength: 512
          name:
            type: string
            description: Name of the test that these availability results represent.
            maxLength: 1024
          duration:
            type: string
            description: >-
              Duration in format: DD.HH:MM:SS.MMMMMM. Must be less than 1000
              days.
          success:
            type: boolean
            x-nullable: false
            description: Success flag.
          runLocation:
            type: string
            description: Name of the location where the test was run from.
            maxLength: 1024
          message:
            type: string
            description: Diagnostic message for the result.
            maxLength: 8192
          properties:
            type: object
            description: Collection of custom properties.
            additionalProperties:
              type: string
              maxLength: 8192
          measurements:
            type: object
            description: Collection of custom measurements.
            additionalProperties:
              type: number
              format: double
  Base:
    x-ms-client-name: MonitorBase
    type: object
    description: Data struct to contain only C section with custom fields.
    properties:
      baseType:
        type: string
        description: >-
          Name of item (B section) if any. If telemetry data is derived straight
          from this, this should be null.
      baseData:
        $ref: '#/definitions/Domain'
        description: The data payload for the telemetry request
  DataPoint:
    x-ms-client-name: MetricDataPoint
    type: object
    description: Metric data single measurement.
    required:
      - name
      - value
    properties:
      ns:
        x-ms-client-name: namespace
        type: string
        description: Namespace of the metric.
        maxLength: 256
      name:
        type: string
        description: Name of the metric.
        maxLength: 1024
      kind:
        x-ms-client-name: dataPointType
        $ref: '#/definitions/DataPointType'
        description: Metric type. Single measurement or the aggregated value.
      value:
        type: number
        description: >-
          Single value for measurement. Sum of individual measurements for the
          aggregation.
        format: double
      count:
        type: number
        format: int32
        description: >-
          Metric weight of the aggregated metric. Should not be set for a
          measurement.
        x-nullable: true
      min:
        type: number
        format: double
        description: >-
          Minimum value of the aggregated metric. Should not be set for a
          measurement.
        x-nullable: true
      max:
        type: number
        format: double
        description: >-
          Maximum value of the aggregated metric. Should not be set for a
          measurement.
        x-nullable: true
      stdDev:
        type: number
        format: double
        description: >-
          Standard deviation of the aggregated metric. Should not be set for a
          measurement.
        x-nullable: true
  DataPointType:
    type: string
    description: Type of the metric data measurement.
    enum:
      - Measurement
      - Aggregation
  Domain:
    x-ms-client-name: MonitorDomain
    type: object
    description: The abstract common base of all domains.
    required:
      - ver
    additionalProperties: true
    properties:
      ver:
        x-ms-client-name: version
        type: integer
        format: int32
        description: Schema version
        default: 2
  EventData:
    x-ms-client-name: TelemetryEventData
    allOf:
      - $ref: '#/definitions/Domain'
      - type: object
        description: >-
          Instances of Event represent structured event records that can be
          grouped and searched by their properties. Event data item also creates
          a metric of event count by name.
        required:
          - name
        properties:
          name:
            type: string
            description: >-
              Event name. Keep it low cardinality to allow proper grouping and
              useful metrics.
            maxLength: 512
          properties:
            type: object
            description: Collection of custom properties.
            additionalProperties:
              type: string
              maxLength: 8192
          measurements:
            type: object
            description: Collection of custom measurements.
            additionalProperties:
              type: number
              format: double
  ExceptionData:
    x-ms-client-name: TelemetryExceptionData
    allOf:
      - $ref: '#/definitions/Domain'
      - type: object
        description: >-
          An instance of Exception represents a handled or unhandled exception
          that occurred during execution of the monitored application.
        required:
          - exceptions
        properties:
          exceptions:
            type: array
            description: Exception chain - list of inner exceptions.
            items:
              $ref: '#/definitions/ExceptionDetails'
          severityLevel:
            x-nullable: true
            description: >-
              Severity level. Mostly used to indicate exception severity level
              when it is reported by logging library.
            $ref: '#/definitions/SeverityLevel'
          problemId:
            type: string
            description: >-
              Identifier of where the exception was thrown in code. Used for
              exceptions grouping. Typically a combination of exception type and
              a function from the call stack.
            maxLength: 1024
          properties:
            type: object
            description: Collection of custom properties.
            additionalProperties:
              type: string
              maxLength: 8192
          measurements:
            type: object
            description: Collection of custom measurements.
            additionalProperties:
              type: number
              format: double
  ExceptionDetails:
    x-ms-client-name: TelemetryExceptionDetails
    type: object
    description: Exception details of the exception in a chain.
    required:
      - message
    properties:
      id:
        type: number
        format: int32
        description: >-
          In case exception is nested (outer exception contains inner one), the
          id and outerId properties are used to represent the nesting.
      outerId:
        type: number
        format: int32
        description: >-
          The value of outerId is a reference to an element in ExceptionDetails
          that represents the outer exception
      typeName:
        type: string
        description: Exception type name.
        maxLength: 1024
      message:
        type: string
        description: Exception message.
        maxLength: 32768
      hasFullStack:
        type: boolean
        default: true
        description: >-
          Indicates if full exception stack is provided in the exception. The
          stack may be trimmed, such as in the case of a StackOverflow
          exception.
      stack:
        type: string
        description: >-
          Text describing the stack. Either stack or parsedStack should have a
          value.
        maxLength: 32768
      parsedStack:
        type: array
        description: List of stack frames. Either stack or parsedStack should have a value.
        items:
          $ref: '#/definitions/StackFrame'
  MessageData:
    allOf:
      - $ref: '#/definitions/Domain'
      - type: object
        description: >-
          Instances of Message represent printf-like trace statements that are
          text-searched. Log4Net, NLog and other text-based log file entries are
          translated into instances of this type. The message does not have
          measurements.
        required:
          - message
        properties:
          message:
            type: string
            description: Trace message
            maxLength: 32768
          severityLevel:
            $ref: '#/definitions/SeverityLevel'
            description: Trace severity level.
          properties:
            type: object
            description: Collection of custom properties.
            additionalProperties:
              type: string
              maxLength: 8192
          measurements:
            type: object
            description: Collection of custom measurements.
            additionalProperties:
              type: number
              format: double
  MetricsData:
    allOf:
      - $ref: '#/definitions/Domain'
      - type: object
        description: >-
          An instance of the Metric item is a list of measurements (single data
          points) and/or aggregations.
        required:
          - metrics
        properties:
          metrics:
            type: array
            description: >-
              List of metrics. Only one metric in the list is currently
              supported by Application Insights storage. If multiple data points
              were sent only the first one will be used.
            items:
              $ref: '#/definitions/DataPoint'
          properties:
            type: object
            description: Collection of custom properties.
            additionalProperties:
              type: string
              maxLength: 8192
  PageViewData:
    allOf:
      - $ref: '#/definitions/Domain'
      - type: object
        description: >-
          An instance of PageView represents a generic action on a page like a
          button click. It is also the base type for PageView.
        required:
          - id
          - name
        properties:
          id:
            type: string
            description: >-
              Identifier of a page view instance. Used for correlation between
              page view and other telemetry items.
            maxLength: 512
          name:
            type: string
            description: >-
              Event name. Keep it low cardinality to allow proper grouping and
              useful metrics.
            maxLength: 1024
          url:
            type: string
            description: Request URL with all query string parameters
            maxLength: 2048
          duration:
            type: string
            description: >-
              Request duration in format: DD.HH:MM:SS.MMMMMM. For a page view
              (PageViewData), this is the duration. For a page view with
              performance information (PageViewPerfData), this is the page load
              time. Must be less than 1000 days.
          referredUri:
            type: string
            description: >-
              Fully qualified page URI or URL of the referring page; if unknown,
              leave blank
            maxLength: 2048
          properties:
            type: object
            description: Collection of custom properties.
            additionalProperties:
              type: string
              maxLength: 8192
          measurements:
            type: object
            description: Collection of custom measurements.
            additionalProperties:
              type: number
              format: double
  PageViewPerfData:
    allOf:
      - $ref: '#/definitions/Domain'
      - type: object
        description: >-
          An instance of PageViewPerf represents: a page view with no
          performance data, a page view with performance data, or just the
          performance data of an earlier page request.
        required:
          - id
          - name
        properties:
          id:
            type: string
            description: >-
              Identifier of a page view instance. Used for correlation between
              page view and other telemetry items.
            maxLength: 512
          name:
            type: string
            description: >-
              Event name. Keep it low cardinality to allow proper grouping and
              useful metrics.
            maxLength: 1024
          url:
            type: string
            description: Request URL with all query string parameters
            maxLength: 2048
          duration:
            type: string
            description: >-
              Request duration in format: DD.HH:MM:SS.MMMMMM. For a page view
              (PageViewData), this is the duration. For a page view with
              performance information (PageViewPerfData), this is the page load
              time. Must be less than 1000 days.
          perfTotal:
            type: string
            description: >-
              Performance total in TimeSpan 'G' (general long) format:
              d:hh:mm:ss.fffffff
          networkConnect:
            type: string
            description: >-
              Network connection time in TimeSpan 'G' (general long) format:
              d:hh:mm:ss.fffffff
          sentRequest:
            type: string
            description: >-
              Sent request time in TimeSpan 'G' (general long) format:
              d:hh:mm:ss.fffffff
          receivedResponse:
            type: string
            description: >-
              Received response time in TimeSpan 'G' (general long) format:
              d:hh:mm:ss.fffffff
          domProcessing:
            type: string
            description: >-
              DOM processing time in TimeSpan 'G' (general long) format:
              d:hh:mm:ss.fffffff
          properties:
            type: object
            description: Collection of custom properties.
            additionalProperties:
              type: string
              maxLength: 8192
          measurements:
            type: object
            description: Collection of custom measurements.
            additionalProperties:
              type: number
              format: double
  RemoteDependencyData:
    allOf:
      - $ref: '#/definitions/Domain'
      - type: object
        description: >-
          An instance of Remote Dependency represents an interaction of the
          monitored component with a remote component/service like SQL or an
          HTTP endpoint.
        required:
          - name
          - duration
        properties:
          id:
            type: string
            description: >-
              Identifier of a dependency call instance. Used for correlation
              with the request telemetry item corresponding to this dependency
              call.
            maxLength: 512
          name:
            type: string
            description: >-
              Name of the command initiated with this dependency call. Low
              cardinality value. Examples are stored procedure name and URL path
              template.
            maxLength: 1024
          resultCode:
            type: string
            description: >-
              Result code of a dependency call. Examples are SQL error code and
              HTTP status code.
            maxLength: 1024
          data:
            type: string
            description: >-
              Command initiated by this dependency call. Examples are SQL
              statement and HTTP URL with all query parameters.
            maxLength: 8192
          type:
            type: string
            description: >-
              Dependency type name. Very low cardinality value for logical
              grouping of dependencies and interpretation of other fields like
              commandName and resultCode. Examples are SQL, Azure table, and
              HTTP.
            maxLength: 1024
          target:
            type: string
            description: >-
              Target site of a dependency call. Examples are server name, host
              address.
            maxLength: 1024
          duration:
            type: string
            description: >-
              Request duration in format: DD.HH:MM:SS.MMMMMM. Must be less than
              1000 days.
          success:
            type: boolean
            description: Indication of successful or unsuccessful call.
            default: true
          properties:
            type: object
            description: Collection of custom properties.
            additionalProperties:
              type: string
              maxLength: 8192
          measurements:
            type: object
            description: Collection of custom measurements.
            additionalProperties:
              type: number
              format: double
  RequestData:
    allOf:
      - $ref: '#/definitions/Domain'
      - type: object
        description: >-
          An instance of Request represents completion of an external request to
          the application to do work and contains a summary of that request
          execution and the results.
        required:
          - id
          - duration
          - responseCode
          - success
        properties:
          id:
            type: string
            description: >-
              Identifier of a request call instance. Used for correlation
              between request and other telemetry items.
            maxLength: 512
          name:
            type: string
            description: >-
              Name of the request. Represents code path taken to process
              request. Low cardinality value to allow better grouping of
              requests. For HTTP requests it represents the HTTP method and URL
              path template like 'GET /values/{id}'.
            maxLength: 1024
          duration:
            type: string
            description: >-
              Request duration in format: DD.HH:MM:SS.MMMMMM. Must be less than
              1000 days.
          success:
            type: boolean
            description: Indication of successful or unsuccessful call.
            default: true
          responseCode:
            type: string
            description: Result of a request execution. HTTP status code for HTTP requests.
            maxLength: 1024
          source:
            type: string
            description: >-
              Source of the request. Examples are the instrumentation key of the
              caller or the ip address of the caller.
            maxLength: 1024
          url:
            type: string
            description: Request URL with all query string parameters.
            maxLength: 2048
          properties:
            type: object
            description: Collection of custom properties.
            additionalProperties:
              type: string
              maxLength: 8192
          measurements:
            type: object
            description: Collection of custom measurements.
            additionalProperties:
              type: number
              format: double
  SeverityLevel:
    type: string
    description: Defines the level of severity for the event.
    enum:
      - Verbose
      - Information
      - Warning
      - Error
      - Critical
  StackFrame:
    type: object
    description: Stack frame information.
    required:
      - level
      - method
    properties:
      level:
        type: number
        format: int32
        description: ''
      method:
        type: string
        description: Method name.
        maxLength: 1024
      assembly:
        type: string
        description: Name of the assembly (dll, jar, etc.) containing this function.
        maxLength: 1024
      fileName:
        type: string
        description: File name or URL of the method implementation.
        maxLength: 1024
      line:
        type: number
        format: int32
        description: Line number of the code implementation.
  TrackResponse:
    description: Response containing the status of each telemetry item.
    type: object
    properties:
      itemsReceived:
        type: number
        format: int32
        description: The number of items received.
      itemsAccepted:
        type: number
        format: int32
        description: The number of items accepted.
      errors:
        type: array
        description: An array of error detail objects.
        items:
          $ref: '#/definitions/ErrorDetails'
  ErrorDetails:
    x-ms-client-name: TelemetryErrorDetails
    description: The error details
    type: object
    properties:
      index:
        type: number
        format: int32
        description: The index in the original payload of the item.
      statusCode:
        type: number
        format: int32
        description: The item specific [HTTP Response status code](#Response Status Codes).
      message:
        type: string
        description: The error message.
  TelemetryEnvelope:
    x-ms-client-name: TelemetryItem
    description: System variables for a telemetry item.
    type: object
    required:
      - name
      - time
    properties:
      ver:
        type: number
        x-ms-client-name: version
        format: int32
        default: 1
        description: >-
          Envelope version. For internal use only. By assigning this the
          default, it will not be serialized within the payload unless changed
          to a value other than #1.
      name:
        type: string
        description: Type name of telemetry data item.
      time:
        type: string
        format: date-time
        description: >-
          Event date time when telemetry item was created. This is the wall
          clock time on the client when the event was generated. There is no
          guarantee that the client's time is accurate. This field must be
          formatted in UTC ISO 8601 format, with a trailing 'Z' character, as
          described publicly on https://en.wikipedia.org/wiki/ISO_8601#UTC.
          Note: the number of decimal seconds digits provided are variable (and
          unspecified). Consumers should handle this, i.e. managed code
          consumers should not use format 'O' for parsing as it specifies a
          fixed length. Example: 2009-06-15T13:45:30.0000000Z.
      sampleRate:
        type: number
        format: float
        default: 100
        description: >-
          Sampling rate used in application. This telemetry item represents 100
          / sampleRate actual telemetry items.
      seq:
        type: string
        x-ms-client-name: sequence
        maxLength: 64
        description: Sequence field used to track absolute order of uploaded events.
      iKey:
        type: string
        x-ms-client-name: instrumentationKey
        description: The instrumentation key of the Application Insights resource.
      tags:
        type: object
        description: >-
          Key/value collection of context properties. See ContextTagKeys for
          information on available properties.
        additionalProperties:
          type: string
      data:
        $ref: '#/definitions/Base'
        description: Telemetry data item.
  ContextTagKeys:
    type: string
    description: The context tag keys.
    enum:
      - ApplicationVersion
      - DeviceId
      - DeviceLocale
      - DeviceModel
      - DeviceOEMName
      - DeviceOSVersion
      - DeviceType
      - LocationIp
      - LocationCountry
      - LocationProvince
      - LocationCity
      - OperationId
      - OperationName
      - OperationParentId
      - OperationSyntheticSource
      - OperationCorrelationVector
      - SessionId
      - SessionIsFirst
      - UserAccountId
      - UserId
      - UserAuthUserId
      - CloudRole
      - CloudRoleVer
      - CloudRoleInstance
      - CloudLocation
      - InternalSdkVersion
      - InternalAgentVersion
      - 'InternalNodeName  '
    x-ms-enum:
      name: ContextTagKeys
      modelAsString: true
      values:
        - value: ai.application.ver
        - value: ai.device.id
        - value: ai.device.locale
        - value: ai.device.model
        - value: ai.device.oemName
        - value: ai.device.osVersion
        - value: ai.device.type
        - value: ai.location.ip
        - value: ai.location.country
        - value: ai.location.province
        - value: ai.location.city
        - value: ai.operation.id
        - value: ai.operation.name
        - value: ai.operation.parentId
        - value: ai.operation.syntheticSource
        - value: ai.operation.correlationVector
        - value: ai.session.id
        - value: ai.session.isFirst
        - value: ai.user.accountId
        - value: ai.user.id
        - value: ai.user.authUserId
        - value: ai.cloud.role
        - value: ai.cloud.roleVer
        - value: ai.cloud.roleInstance
        - value: ai.cloud.location
        - value: ai.internal.sdkVersion
        - value: ai.internal.agentVersion
        - value: ai.internal.nodeName
parameters:
  Host:
    name: Host
    description: 'Breeze endpoint: https://dc.services.visualstudio.com'
    x-ms-parameter-location: client
    default: https://dc.services.visualstudio.com
    required: true
    type: string
    in: path
    x-ms-skip-url-encoding: true
tags:
  - name: Track