Skip to content

Commit 00c06ed

Browse files
authored
Merge pull request #193324 from JimacoMS4/add-azure-monitor-topics-to-dps
Align DPS monitoring topics with IoT Hub and Azure Monitor
2 parents 17e84c2 + 1b7d765 commit 00c06ed

File tree

8 files changed

+271
-22
lines changed

8 files changed

+271
-22
lines changed

articles/azure-monitor/essentials/resource-logs-schema.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ The schema for resource logs varies depending on the resource and log category.
7474
| Azure Firewall | [Logging for Azure Firewall](../../firewall/logs-and-metrics.md#diagnostic-logs) |
7575
| Azure Front Door | [Logging for Azure Front Door](../../frontdoor/front-door-diagnostics.md) |
7676
| Azure IoT Hub | [IoT Hub operations](../../iot-hub/monitor-iot-hub-reference.md#resource-logs) |
77+
| Azure IoT Hub Device Provisioning Service| [Device Provisioning Service operations](../../iot-dps/monitor-iot-dps-reference.md#resource-logs) |
7778
| Azure Key Vault |[Azure Key Vault logging](../../key-vault/general/logging.md) |
7879
| Azure Kubernetes Service |[Azure Kubernetes Service logging](../../aks/monitor-aks-reference.md#resource-logs) |
7980
| Azure Load Balancer |[Log Analytics for Azure Load Balancer](../../load-balancer/monitor-load-balancer.md) |

articles/iot-dps/how-to-troubleshoot-dps.md

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,43 +6,36 @@ manager: nberdy
66
ms.service: iot-dps
77
services: iot-dps
88
ms.topic: conceptual
9-
ms.date: 02/14/2021
9+
ms.date: 04/15/2022
1010
ms.author: xujing
1111
#Customer intent: As an operator for Azure IoT Hub DPS, I need to know how to find out when devices are disconnecting unexpectedly and troubleshoot resolve those issues right away.
1212
---
1313

1414
# Troubleshooting with Azure IoT Hub Device Provisioning Service
1515

16-
Connectivity issues for IoT devices can be difficult to troubleshoot because there are many possible points of failures such as attestation failures, registration failures etc. This article provides guidance on how to detect and troubleshoot device connectivity issues via [Azure Monitor](../azure-monitor/overview.md).
16+
Connectivity issues for IoT devices can be difficult to troubleshoot because there are many possible points of failures such as attestation failures, registration failures etc. This article provides guidance on how to detect and troubleshoot device connectivity issues via Azure Monitor. To learn more about using Azure Monitor with DPS, see [Monitor Device Provisioning Service](monitor-iot-dps.md).
1717

1818
## Using Azure Monitor to view metrics and set up alerts
1919

20-
The following procedure describes how to view and set up alert on IoT Hub Device Provisioning Service metric.
20+
To view and set up alerts on IoT Hub Device Provisioning Service metrics:
2121

2222
1. Sign in to the [Azure portal](https://portal.azure.com).
2323

2424
2. Browse to your IoT Hub Device Provisioning Service.
2525

2626
3. Select **Metrics**.
2727

28-
4. Select the desired metric.
29-
<br />Currently there are three metrics for DPS:
30-
31-
| Metric Name | Description |
32-
|-------|------------|
33-
| Attestation attempts | Number of devices that attempted to authenticate with Device Provisioning Service|
34-
| Registration attempts | Number of devices that attempted to register to IoT Hub after successful authentication|
35-
| Device assigned | Number of devices that successfully assigned to IoT Hub|
28+
4. Select the desired metric. For supported metrics, see [Metrics](monitor-iot-dps-reference.md#metrics).
3629

3730
5. Select desired aggregation method to create a visual view of the metric.
3831

3932
6. To set up an alert of a metric, select **New alert rules** from the top right of the metric blade, similarly you can go to **Alert** blade and select **New alert rules**.
4033

4134
7. Select **Add condition**, then select the desired metric and threshold by following prompts.
4235

43-
To learn more, see [alerts in Azure Monitor](../azure-monitor/alerts/alerts-overview.md).
36+
To learn more about viewing metrics and setting up alerts on your DPS instance, see [Analyzing metrics](monitor-iot-dps.md#analyzing-metrics) and [Alerts](monitor-iot-dps.md#alerts) in Monitor Device Provisioning Service.
4437

45-
## Using Log Analytic to view and resolve errors
38+
## Using Log Analytics to view and resolve errors
4639

4740
1. Sign in to the [Azure portal](https://portal.azure.com).
4841

@@ -52,12 +45,7 @@ To learn more, see [alerts in Azure Monitor](../azure-monitor/alerts/alerts-over
5245

5346
4. Select **Add diagnostic setting**.
5447

55-
5. Configure the desired logs to be collected.
56-
57-
| Log Name | Description |
58-
|-------|------------|
59-
| DeviceOperations | Logs related to device connection events |
60-
| ServiceOperations | Event logs related to using service SDK (e.g. Creating or updating enrollment groups)|
48+
5. Configure the desired logs to be collected. For supported categories, see [Resource logs](monitor-iot-dps-reference.md#resource-logs).
6149

6250
6. Tick the box **Send to Log Analytics** ([see pricing](https://azure.microsoft.com/pricing/details/log-analytics/)) and save.
6351

@@ -67,8 +55,8 @@ To learn more, see [alerts in Azure Monitor](../azure-monitor/alerts/alerts-over
6755

6856
9. If there are results, look for `OperationName`, `ResultType`, `ResultSignature`, and `ResultDescription` (error message) to get more detail on the error.
6957

70-
7158
## Common error codes
59+
7260
Use this table to understand and resolve common errors.
7361

7462
| Error Code| Description | HTTP Status Code |
@@ -79,3 +67,9 @@ Use this table to understand and resolve common errors.
7967
| 412 | The ETag in the request does not match the ETag of the existing resource, as per RFC7232. | 412 Precondition failed |
8068
| 429 | Operations are being throttled by the service. For specific service limits, see [IoT Hub Device Provisioning Service limits](../azure-resource-manager/management/azure-subscription-service-limits.md#iot-hub-device-provisioning-service-limits). | 429 Too many requests |
8169
| 500 | An internal error occurred. | 500 Internal Server Error|
70+
71+
## Next Steps
72+
73+
- To learn more about using Azure Monitor with DPS, see [Monitor Device Provisioning Service](monitor-iot-dps.md).
74+
75+
- To learn about metrics, logs, and schemas emitted for DPS in Azure Monitor, see [Monitoring Device Provisioning Service data reference](monitor-iot-dps-reference.md).
44 KB
Loading
151 KB
Loading
76.9 KB
Loading
Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
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

Comments
 (0)