Monitoring Azure IoT Hub Device Provisioning Service
When you have critical applications and business processes relying on Azure resources, you want to monitor those resources for their availability, performance, and operation.
This article describes the monitoring data generated by Azure IoT Hub Device Provisioning Service (DPS). DPS uses Azure Monitor. If you are unfamiliar with the features of Azure Monitor common to all Azure services that use it, read Monitoring Azure resources with Azure Monitor.
DPS collects the same kinds of monitoring data as other Azure resources that are described in Monitoring data from Azure resources.
See Monitoring Azure IoT Hub Device Provisioning Service data reference for detailed information on the metrics and logs created by DPS.
Collection and routing
Platform metrics and the Activity log are collected and stored automatically, but can be routed to other locations by using a diagnostic setting.
Resource Logs are not collected and stored until you create a diagnostic setting and route them to one or more locations.
In Azure portal, you can select Diagnostic settings under Monitoring on the left-pane of your DPS instance followed by Add diagnostic setting to create diagnostic settings scoped to the logs and platform metrics emitted by your instance.
The following screenshot shows a diagnostic setting for routing to a Log Analytics workspace.
See Create diagnostic setting to collect platform logs and metrics in Azure for the detailed process for creating a diagnostic setting using the Azure portal, CLI, or PowerShell. When you create a diagnostic setting, you specify which categories of logs to collect. The categories for DPS are listed in Resource logs in the Azure IoT Hub Device Provisioning Service monitoring data reference.
The metrics and logs you can collect are discussed in the following sections.
You can analyze metrics for DPS with metrics from other Azure services using metrics explorer by opening Metrics from the Azure Monitor menu. See Analyze metrics with Azure Monitor metrics explorer for details on using this tool.
In Azure portal, you can select Metrics under Monitoring on the left-pane of your DPS instance to open metrics explorer scoped, by default, to the platform metrics emitted by your instance:
For a list of the platform metrics collected for DPS, see Metrics in the Monitoring Azure IoT Hub Device Provisioning Service data reference.
For reference, you can see a list of all resource metrics supported in Azure Monitor.
Data in Azure Monitor Logs is stored in tables where each table has its own set of unique properties.
To route data to Azure Monitor Logs, you must create a diagnostic setting to send resource logs or platform metrics to a Log Analytics workspace. To learn more, see Collection and routing.
In Azure portal, you can select Logs under Monitoring on the left-pane of your DPS instance to perform Log Analytics queries scoped, by default, to the logs and metrics collected in Azure Monitor Logs for your instance.
When you select Logs from the DPS menu, Log Analytics is opened with the query scope set to the current DPS instance. This means that log queries will only include data from that resource. If you want to run a query that includes data from other DPS instances or data from other Azure services, select Logs from the Azure Monitor menu. See Log query scope and time range in Azure Monitor Log Analytics for details.
Run queries against the AzureDiagnostics table to see the resource logs collected for the diagnostic settings you've created for your DPS instance.
All resource logs in Azure Monitor have the same fields followed by service-specific fields. The common schema is outlined in Azure Monitor resource log schema The schema for DPS resource logs is found in Resource logs in the Monitoring Azure IoT Hub Device Provisioning Service data reference.
The Activity log is a type of platform log in Azure that provides insight into subscription-level events. You can view it independently or route it to Azure Monitor Logs, where you can do much more complex queries using Log Analytics.
For a list of the types of resource logs collected for DPS, see Resource logs in the Monitoring Azure IoT Hub Device Provisioning Service data reference.
For a list of the tables used by Azure Monitor Logs and queryable by Log Analytics, see Azure Monitor Logs tables in the Monitoring Azure IoT Hub Device Provisioning Service data reference.
Azure Monitor alerts proactively notify you when important conditions are found in your monitoring data. They allow you to identify and address issues in your system before your customers notice them. You can set alerts on metrics, logs, and the activity log. Different types of alerts have benefits and drawbacks.
See Monitoring Azure IoT Hub Device Provisioning Service data reference for a reference of the metrics, logs, and other important values created by DPS.
See Monitoring Azure resources with Azure Monitor for details on monitoring Azure resources.