|
| 1 | +#Telemetry Documentation |
| 2 | + |
| 3 | +> Two types of telemetry are used to monitor and analyze execution of Azure CLI commands. One called ARM telemetry is recorded basing on HTTP traffic by ARM, and another is client side telemetry sent by Azure CLI. |
| 4 | +
|
| 5 | +## ARM Telemetry |
| 6 | + |
| 7 | +ARM telemetry tracks all HTTP requests and responses through ARM endpoint. As far as we know, below cases don't have ARM telemetry record. |
| 8 | +- Command doesn't create request successfully, for instance, parameter cannot pass validation, request or payload cannot be constructed. |
| 9 | +- Command calls data plane service API. |
| 10 | +- Network is inaccessible. |
| 11 | +- No request is needed during execution. |
| 12 | + |
| 13 | +Kusto Cluster and Database: https://dataexplorer.azure.com/clusters/armprod/databases/ARMProd |
| 14 | + |
| 15 | + |
| 16 | +## CLI Client Telemetry |
| 17 | + |
| 18 | +Client side telemetry is sent at the end of Azure CLI command execution. It covers all commands, no matter if it has http requests or just has local operations. |
| 19 | +Sanitized data is stored in Kusto cluster which is managed by DevDiv Data team. |
| 20 | + |
| 21 | +Kusto Cluster and Database: https://dataexplorer.azure.com/clusters/ddazureclients/databases/AzureCli |
| 22 | + |
| 23 | +All Azure CLI data is stored in a large json named `Properties` in table `RawEventsAzCli`. Some properties are flatten, some are not. Here are some useful fields: |
| 24 | +> The telemetry has different schema pre Azure CLI 2.0.28. All the fields explained below are for new schema, in other words, CLI version > 2.0.28. |
| 25 | +
|
| 26 | +- `EventName`: `azurecli/command` or `azurecli/fault` or `azurecli/extension` |
| 27 | + - `azurecli/command` means this is common event record with general `Properties` field. |
| 28 | + - `azurecli/fault` means this is additional event record with extra exception info in `Properties` field. |
| 29 | + - `azurecli/extension` means this is additional event record with customized info in `Properties` field. |
| 30 | + - Additional event record can be joined with common event record using `CorrelationId`. |
| 31 | +- `CorrelationId`: GUID to join additional event records with common event record |
| 32 | + - `azurecli/extension` event records have the same `CorrelationId` with related `azurecli/command` event record. |
| 33 | + - `azurecli/fault` event has `Properties['reserved.datamodel.correlation.1']` field. The field value is `{correlationId},UserTask,` where `{correlationId}` is `CorrelationId` field of related `azurecli/command` record. |
| 34 | +- `EntityType`: `UserTask`/`Fault` |
| 35 | + - For `EventName == 'azurecli/command'`, the `EntityType` is `UserTask`. |
| 36 | + - For `EventName == 'azurecli/fault'`, the `EntityType` is `Fault`. |
| 37 | +- `EventTimeStamp`: time when the telemetry record is sent |
| 38 | +- `ProductVersion`: CLI core version in the format of `azurecli@{version}` |
| 39 | +- `CoreVersion`: CLI core version |
| 40 | +- `ExeVersion`: `{cli_core_version}@{module_version}`. In the new schema (CLI version > 2.0.28), all module versions are `none`. Hence this field is `{cli_core_version}@none` |
| 41 | +- `OsType`: OS system, eg. linux, windows |
| 42 | +- `OsVersion`: OS platform version, eg. 10.0.14942 |
| 43 | +- `PythonVersion`: platform python version |
| 44 | +- `ShellType`: cmd/bash/ksh/zsh/cloud-shell/... Note: may not be accurate. |
| 45 | +- `MacAddressHash`: SHA256 hashed MAC address |
| 46 | +- `MachineId`: GUID coming from the first 128bit of MacAddressHash |
| 47 | +- `UserId`: CLI installation id. Each CLI client installed locally will have a GUID as installation id. It's stored in $homeFolder/.azure/azureProfile.json |
| 48 | +- `SessionId`: SHA256 hashed result of CLI installation id, parent process (terminal session) creation time and parent process (terminal session) id. Note: may not be accurate. |
| 49 | +- `RawCommand`: CLI command name |
| 50 | +- `Params`: CLI command arguments (without argument value) |
| 51 | +- `AzureSubscriptionId`: current subscription id |
| 52 | +- `ClientRequestId`: GUID which is set on HTTP header |
| 53 | +- `StartTime`: time when the command begins executing |
| 54 | +- `EndTime`: time when the command exits |
| 55 | +- `ActionResult`: |
| 56 | + - For `EntityType == 'UserTask'`, it could be `Success`/`Failure`/`UserFault`/`None`. All others besides `Success` means failure. |
| 57 | + - For `EntityType == 'Fault'`, it's empty. |
| 58 | +- `ResultSummary`: details of result, may be suppressed to meet security & privacy requirements. |
| 59 | +- `ExceptionMessage`: details of exception, may be suppressed to meet security & privacy requirements. |
| 60 | +- `Properties`: large json with all constructed fields. Below is to explain some unflattened fields not introduced before. |
| 61 | + - `reserved.datamodel.entityname`: CLI command name with hyphens |
| 62 | + - `reserved.datamodel.correlation.1`: Additional field when `EventName == 'azurecli/fault'`. It's in the format of `{correlationId},UserTask,` where `{correlationId}` is `CorrelationId` field of related `EventName == 'azurecli/command'` record. |
| 63 | + - `reserved.datamodel.fault.typestring`: Additional field when `EventName == 'azurecli/fault'`. It logs the exception class. |
| 64 | + - `reserved.datamodel.fault.description`: Additional field when `EventName == 'azurecli/fault'`. It logs exception description or fault type. |
| 65 | + - `context.default.vs.core.os.platform`: OS platform |
| 66 | + - `context.default.azurecli.source`: `az`/`completer`. It's `completer` if we found argument auto complete settings in os environment variable. |
| 67 | + - `context.default.azurecli.environmentvariables`: It logs customer's environment variables starting with `AZURE_CLI` |
| 68 | + - `context.default.azurecli.extensionname`: It logs the extension name and version in the format of `{extension_name}@{extension_version}` if the command is from CLI extension. |
| 69 | + - `context.default.azurecli.installer`: value of os environment variable `AZ_INSTALLER` |
| 70 | + - `context.default.azurecli.error_type`: It logs the exception class name. |
| 71 | + - `context.default.azurecli.exception_name`: A supplementation for `context.default.azurecli.error_type` |
| 72 | + |
| 73 | +## Accessing Client Telemetry |
| 74 | + |
| 75 | +Kusto Cluster and Database: https://dataexplorer.azure.com/clusters/ddazureclients/databases/AzureCli |
| 76 | + |
| 77 | +To ensure you have a smooth experience using our Data Tools and Data, you have to take the required trainings and join a security group. |
| 78 | +Please follow instruction [Accessing DevDiv Data](https://devdiv.visualstudio.com/DevDiv/_wiki/wikis/DevDiv.wiki/9768/Accessing-DevDiv-Data) to get access permission. |
| 79 | + |
| 80 | + |
| 81 | +## Doc Sections |
| 82 | + |
| 83 | +- [Kusto Examples](kusto_examples.md) - Samples for kusto query |
| 84 | + |
| 85 | +- [FAQ](faq.md) - Commonly asked questions |
0 commit comments