|
| 1 | +--- |
| 2 | +title: Monitoring Azure IoT Hub Device Provisioning Service data reference #Required; *your official service name* |
| 3 | +description: Important reference material needed when you monitor Azure IoT Hub Device Provisioning Service |
| 4 | +author: kgremban |
| 5 | +ms.topic: reference |
| 6 | +ms.author: kgremban |
| 7 | +ms.service: iot-dps |
| 8 | +ms.custom: subject-monitoring |
| 9 | +ms.date: 04/15/2022 |
| 10 | +--- |
| 11 | + |
| 12 | +# Monitoring Azure IoT Hub Device Provisioning Service data reference |
| 13 | + |
| 14 | +See [Monitoring Iot Hub Device Provisioning Service](monitor-iot-dps.md) for details on collecting and analyzing monitoring data for Azure IoT Hub Device Provisioning Service (DPS). |
| 15 | + |
| 16 | +## Metrics |
| 17 | + |
| 18 | +This section lists all the automatically collected platform metrics collected for DPS. |
| 19 | + |
| 20 | +Resource Provider and Type: [Microsoft.Devices/provisioningServices](/azure/azure-monitor/platform/metrics-supported#microsoftdevicesprovisioningservices). |
| 21 | + |
| 22 | +|Metric|Exportable via Diagnostic Settings?|Metric Display Name|Unit|Aggregation Type|Description|Dimensions| |
| 23 | +|---|---|---|---|---|---|---| |
| 24 | +|AttestationAttempts|Yes|Attestation attempts|Count|Total|Number of device attestations attempted|ProvisioningServiceName, Status, Protocol| |
| 25 | +|DeviceAssignments|Yes|Devices assigned|Count|Total|Number of devices assigned to an IoT hub|ProvisioningServiceName, IotHubName| |
| 26 | +|RegistrationAttempts|Yes|Registration attempts|Count|Total|Number of device registrations attempted|ProvisioningServiceName, IotHubName, Status| |
| 27 | + |
| 28 | +For more information, see a list of [all platform metrics supported in Azure Monitor](/azure/azure-monitor/platform/metrics-supported). |
| 29 | + |
| 30 | +## Metric dimensions |
| 31 | + |
| 32 | +DPS has the following dimensions associated with its metrics. |
| 33 | + |
| 34 | +| Dimension Name | Description | |
| 35 | +| ------------------- | ----------------- | |
| 36 | +| IotHubName | The name of the target IoT hub. | |
| 37 | +| Protocol | The device or service protocol used. | |
| 38 | +| ProvisioningServiceName | The name of the DPS instance. | |
| 39 | +| Status | The status of the operation. | |
| 40 | + |
| 41 | +For more information on what metric dimensions are, see [Multi-dimensional metrics](/azure/azure-monitor/platform/data-platform-metrics#multi-dimensional-metrics). |
| 42 | + |
| 43 | +## Resource logs |
| 44 | + |
| 45 | +This section lists the types of resource logs you can collect for DPS. |
| 46 | + |
| 47 | +Resource Provider and Type: [Microsoft.Devices/provisioningServices](/azure/azure-monitor/essentials/resource-logs-categories#microsoftdevicesprovisioningservices). |
| 48 | + |
| 49 | +| Category | Description | |
| 50 | +|:---------|------------------| |
| 51 | +| DeviceOperations | Logs related to device attestation events. See device APIs listed in [Billable service operations and pricing](about-iot-dps.md#billable-service-operations-and-pricing). | |
| 52 | +| ServiceOperations | Logs related to DPS service events. See DPS service APIs listed in [Billable service operations and pricing](about-iot-dps.md#billable-service-operations-and-pricing). | |
| 53 | + |
| 54 | +For reference, see a list of [all resource logs category types supported in Azure Monitor](/azure/azure-monitor/platform/resource-logs-schema). |
| 55 | + |
| 56 | +DPS uses the [AzureDiagnostics](/azure/azure-monitor/reference/tables/azurediagnostics) table to store resource log information. The following columns are relevant. |
| 57 | + |
| 58 | +| Property | Data type | Description | |
| 59 | +|:--- |:---|:---| |
| 60 | +| ApplicationId | GUID | Application ID used in bearer authorization. | |
| 61 | +| CallerIpAddress | String | A masked source IP address for the event. | |
| 62 | +| Category | String | Type of operation, either **ServiceOperations** or **DeviceOperations**. | |
| 63 | +| CorrelationId | GUID | Customer provided unique identifier for the event. | |
| 64 | +| DurationMs | String | How long it took to perform the event in milliseconds. | |
| 65 | +| Level | Int | The logging severity of the event. For example, Information or Error. | |
| 66 | +| OperationName | String | The type of action performed during the event. For example: Query, Get, Upsert, and so on. | |
| 67 | +| OperationVersion | String | The API Version used during the event. | |
| 68 | +| Resource | String | The name forOF the resource where the event took place. For example, "MYEXAMPLEDPS". | |
| 69 | +| ResourceGroup | String | The name of the resource group where the resource is located. | |
| 70 | +| ResourceId | String | The Azure Resource Manager Resource ID for the resource where the event took place. | |
| 71 | +| ResourceProvider | String | The resource provider for the the event. For example, "MICROSOFT.DEVICES". | |
| 72 | +| ResourceType | String | The resource type for the event. For example, "PROVISIONINGSERVICES". | |
| 73 | +| ResultDescription | String | Error details for the event if unsuccessful. | |
| 74 | +| ResultSignature | String | HTTP status code for the event if unsuccessful. | |
| 75 | +| ResultType | String | Outcome of the event: Success, Failure, ClientError, and so on. | |
| 76 | +| SubscriptionId | GUID | The subscription ID of the Azure subscription where the resource is located. | |
| 77 | +| TenantId | GUID | The tenant ID for the Azure tenant where the resource is located. | |
| 78 | +| TimeGenerated | DateTime | The date and time that this event occurred, in UTC. | |
| 79 | +| location_s | String | The Azure region where the event took place. | |
| 80 | +| properties_s | JSON | Additional information details for the event. | |
| 81 | + |
| 82 | +### DeviceOperations |
| 83 | + |
| 84 | +The following JSON is an example of a successful attestation attempt from a device. The registration ID for the device is identified in the `properties_s` property. |
| 85 | + |
| 86 | +```json |
| 87 | + { |
| 88 | + "CallerIPAddress": "24.18.226.XXX", |
| 89 | + "Category": "DeviceOperations", |
| 90 | + "CorrelationId": "68952383-80c0-436f-a2e3-f8ae9a41c69d", |
| 91 | + "DurationMs": "226", |
| 92 | + "Level": "Information", |
| 93 | + "OperationName": "AttestationAttempt", |
| 94 | + "OperationVersion": "March2019", |
| 95 | + "Resource": "MYEXAMPLEDPS", |
| 96 | + "ResourceGroup": "MYRESOURCEGROUP", |
| 97 | + "ResourceId": "/SUBSCRIPTIONS/747F1067-xxx-xxx-xxxx-9DEAA894152F/RESOURCEGROUPS/MYRESOURCEGROUP/PROVIDERS/MICROSOFT.DEVICES/PROVISIONINGSERVICES/MYEXAMPLEDPS", |
| 98 | + "ResourceProvider": "MICROSOFT.DEVICES", |
| 99 | + "ResourceType": "PROVISIONINGSERVICES", |
| 100 | + "ResultDescription": "", |
| 101 | + "ResultSignature": "", |
| 102 | + "ResultType": "Success", |
| 103 | + "SourceSystem": "Azure", |
| 104 | + "SubscriptionId": "747F1067-xxx-xxx-xxxx-9DEAA894152F", |
| 105 | + "TenantId": "37dcb621-xxxx-xxxx-xxxx-e8c8addbc4e5", |
| 106 | + "TimeGenerated": "2022-04-02T00:05:51Z", |
| 107 | + "Type": "AzureDiagnostics", |
| 108 | + "_ResourceId": "/subscriptions/747F1067-xxx-xxx-xxxx-9DEAA894152F/resourcegroups/myresourcegroup/providers/microsoft.devices/provisioningservices/myexampledps", |
| 109 | + "location_s": "centralus", |
| 110 | + "properties_s": "{\"id\":\"my-device-1\",\"type\":\"Registration\",\"protocol\":\"Mqtt\"}", |
| 111 | + } |
| 112 | + |
| 113 | +``` |
| 114 | + |
| 115 | +### ServiceOperations |
| 116 | + |
| 117 | +The following JSON is an example of a successful add (`Upsert`) individual enrollment operation. The registration ID for the enrollment and the type of enrollment are identified in the `properties_s` property. |
| 118 | + |
| 119 | +```json |
| 120 | + { |
| 121 | + "CallerIPAddress": "13.91.244.XXX", |
| 122 | + "Category": "ServiceOperations", |
| 123 | + "CorrelationId": "23bd419d-d294-452b-9b1b-520afef5ef52", |
| 124 | + "DurationMs": "98", |
| 125 | + "Level": "Information", |
| 126 | + "OperationName": "Upsert", |
| 127 | + "OperationVersion": "October2021", |
| 128 | + "Resource": "MYEXAMPLEDPS", |
| 129 | + "ResourceGroup": "MYRESOURCEGROUP", |
| 130 | + "ResourceId": "/SUBSCRIPTIONS/747F1067-xxxx-xxxx-xxxx-9DEAA894152F/RESOURCEGROUPS/MYRESOURCEGROUP/PROVIDERS/MICROSOFT.DEVICES/PROVISIONINGSERVICES/MYEXAMPLEDPS", |
| 131 | + "ResourceProvider": "MICROSOFT.DEVICES", |
| 132 | + "ResourceType": "PROVISIONINGSERVICES", |
| 133 | + "ResultDescription": "", |
| 134 | + "ResultSignature": "", |
| 135 | + "ResultType": "Success", |
| 136 | + "SourceSystem": "Azure", |
| 137 | + "SubscriptionId": "747f1067-xxxx-xxxx-xxxx-9deaa894152f", |
| 138 | + "TenantId": "37dcb621-xxxx-xxxx-xxxx-e8c8addbc4e5", |
| 139 | + "TimeGenerated": "2022-04-01T00:52:00Z", |
| 140 | + "Type": "AzureDiagnostics", |
| 141 | + "_ResourceId": "/subscriptions/747F1067-xxxx-xxxx-xxxx-9DEAA894152F/resourcegroups/myresourcegroup/providers/microsoft.devices/provisioningservices/myexampledps", |
| 142 | + "location_s": "centralus", |
| 143 | + "properties_s": "{\"id\":\"my-device-1\",\"type\":\"IndividualEnrollment\",\"protocol\":\"Http\"}", |
| 144 | + } |
| 145 | +``` |
| 146 | + |
| 147 | +## Azure Monitor Logs tables |
| 148 | + |
| 149 | +This section refers to all of the Azure Monitor Logs Kusto tables relevant to DPS and available for query by Log Analytics. For a list of these tables and links to more information for the DPS resource type, see [Device Provisioning Services](/azure/azure-monitor/reference/tables/tables-resourcetype#device-provisioning-services) in the Azure Monitor Logs table reference. |
| 150 | + |
| 151 | +For a reference of all Azure Monitor Logs / Log Analytics tables, see the [Azure Monitor Log Table Reference](/azure/azure-monitor/reference/tables/tables-resourcetype). |
| 152 | + |
| 153 | +## Activity log |
| 154 | + |
| 155 | +For more information on the schema of Activity Log entries, see [Activity Log schema](/azure/azure-monitor/essentials/activity-log-schema). |
| 156 | + |
| 157 | +## See Also |
| 158 | + |
| 159 | +- See [Monitoring Azure IoT Hub Device Provisioning Service](monitor-iot-dps.md) for a description of monitoring Azure IoT Hub Device Provisioning Service. |
| 160 | + |
| 161 | +- See [Monitoring Azure resources with Azure Monitor](/azure/azure-monitor/insights/monitor-azure-resources) for details on monitoring Azure resources. |
0 commit comments