0
votes

Is context telemetry "grouped" during the sampling of request telemetry?

For example, the data below contains a request which has a sample count of 10 ("count": 10), meaning that it is being used to represent 9 other "similar" requests; 90% of the telemetry has actually been discarded.

Does Application Insights only sample data together when the context data is exactly the same for the requests? For example, can I assume that the other 9 requests were also from 41.191.204.0 and have a custom field company of value 22f0141f-b3dc-53e1-86b8-dd0727c14497?

{
  "request": [
    {
      "id": "bs6o2dRoL/Q=",
      "name": "GET /api/resources",
      "count": 10,
      "responseCode": 200,
      "success": true,
      "url": "https://example.com/api/resources",
      "urlData": {
        "base": "/api/resources",
        "host": "example.com",
        "hashTag": "",
        "protocol": "https"
      },
      "durationMetric": {
        "value": 1073743.0,
        "count": 11.0,
        "min": 97613.0,
        "max": 97613.0,
        "stdDev": 0.0,
        "sampledValue": 97613.0
      }
    }
  ],
  "internal": {
    "data": {
      "id": "8cbd12ec-9780-11e6-b38b-c5e9335e7642",
      "documentVersion": "1.61"
    }
  },
  "context": {
    "application": {
      "version": "1.0.16286.5"
    },
    "data": {
      "eventTime": "2016-10-21T11:21:16.942Z",
      "isSynthetic": false,
      "samplingRate": 9.09090909090909
    },
    "device": {
      "type": "PC",
      "osVersion": "Windows 10",
      "roleInstance": "RD0003FF727A10",
      "deviceName": "Other",
      "deviceModel": "Other",
      "browser": "Chrome",
      "browserVersion": "Chrome 53.0",
    },
    "user": {
      "isAuthenticated": false
    },
    "session": {
      "isFirst": false
    },
    "operation": {
      "id": "bs6o2dRoL/Q=",
      "parentId": "bs6o2dRoL/Q=",
      "name": "GET Resources/GetResourceAsync [id]"
    },
    "location": {
      "clientip": "41.191.204.0",
      "continent": "Africa",
      "country": "South Africa",
      "province": "Eastern Cape"
    },
    "custom": {
      "dimensions": [
        {
          "company": "22f0141f-b3dc-53e1-86b8-dd0727c14497"
        },
        {
          "factor": "100"
        }
      ]
    }
  }
}
1

1 Answers

1
votes

Application Insights does not group telemetry events based on the context, but based on the Operation ID. This is synchronized between the SDK sampling and the server side sampling to make sure you will be able to navigate between related page views and requests.

So if you want to make sure some events are grouped together in sampling, set their OperationId to be the same.

See here for full details on how Application Insights implements it's sampling.

Hope this helps,

Asaf