Skip to content

Files

Latest commit

d309254 · Mar 10, 2022

History

History
123 lines (83 loc) · 9.68 KB

how-to-monitor-metrics.md

File metadata and controls

123 lines (83 loc) · 9.68 KB
title titleSuffix description author ms.author ms.date ms.topic ms.service
Monitor with metrics
Azure Digital Twins
Learn how to view Azure Digital Twins metrics in Azure Monitor to troubleshoot and oversee your instance.
baanders
baanders
03/10/2022
how-to
digital-twins

Monitor Azure Digital Twins with metrics

The metrics described in this article give you information about the state of Azure Digital Twins resources in your Azure subscription. Azure Digital Twins metrics help you assess the overall health of the Azure Digital Twins service and the resources connected to it. These user-facing statistics help you see what is going on with your Azure Digital Twins and help analyze the root causes of issues without needing to contact Azure support.

Metrics are enabled by default. You can view Azure Digital Twins metrics from the Azure portal.

View the metrics

  1. Create an Azure Digital Twins instance. You can find instructions on how to set up an Azure Digital Twins instance in Set up an instance and authentication.

  2. Find your Azure Digital Twins instance in the Azure portal (you can open the page for it by typing its name into the portal search bar).

    From the instance's menu, select Metrics.

    :::image type="content" source="media/how-to-monitor-metrics/azure-digital-twins-metrics.png" alt-text="Screenshot showing the metrics page for Azure Digital Twins in the Azure portal.":::

    This page displays the metrics for your Azure Digital Twins instance. You can also create custom views of your metrics by selecting the ones you want to see from the list.

  3. You can choose to send your metrics data to an Event Hubs endpoint or an Azure Storage account by selecting Diagnostics settings from the menu, then Add diagnostic setting.

    :::image type="content" source="media/how-to-monitor-diagnostics/diagnostic-settings.png" alt-text="Screenshot showing the diagnostic settings page and button to add in the Azure portal.":::

    For more information about this process, see Monitor with diagnostics logs.

  4. You can choose to set up alerts for your metrics data by selecting Alerts from the menu, then + New alert rule. :::image type="content" source="media/how-to-monitor-alerts/alerts-pre.png" alt-text="Screenshot showing the Alerts page and button to add in the Azure portal.":::

    For more information about this process, see Monitor with alerts.

List of metrics

Azure Digital Twins provides several metrics to give you an overview of the health of your instance and its associated resources. You can also combine information from multiple metrics to paint a bigger picture of the state of your instance.

The following tables describe the metrics tracked by each Azure Digital Twins instance, and how each metric relates to the overall status of your instance.

Metrics for tracking service limits

You can configure these metrics to track when you're approaching a published service limit for some aspect of your solution.

To set up tracking, use the alerts feature in Azure Monitor. You can define thresholds for these metrics so that you receive an alert when a metric reaches a certain percentage of its published limit.

Metric Metric display name Unit Aggregation type Description Dimensions
TwinCount Twin Count (Preview) Count Total Total number of twins in the Azure Digital Twins instance. Use this metric to determine if you're approaching the service limit for max number of twins allowed per instance. None
ModelCount Model Count (Preview) Count Total Total number of models in the Azure Digital Twins instance. Use this metric to determine if you're approaching the service limit for max number of models allowed per instance. None

API request metrics

Metrics having to do with API requests:

Metric Metric display name Unit Aggregation type Description Dimensions
ApiRequests API Requests Count Total The number of API Requests made for Digital Twins read, write, delete, and query operations. Authentication,
Operation,
Protocol,
Status Code,
Status Code Class,
Status Text
ApiRequestsFailureRate API Requests Failure Rate Percent Average The percentage of API requests that the service receives for your instance that give an internal error (500) response code for Digital Twins read, write, delete, and query operations. Authentication,
Operation,
Protocol,
Status Code,
Status Code Class,
Status Text
ApiRequestsLatency API Requests Latency Milliseconds Average The response time for API requests. This value refers to the time from when the request is received by Azure Digital Twins until the service sends a success/fail result for Digital Twins read, write, delete, and query operations. Authentication,
Operation,
Protocol

Billing metrics

Metrics having to do with billing:

Metric Metric display name Unit Aggregation type Description Dimensions
BillingApiOperations Billing API Operations Count Total Billing metric for the count of all API requests made against the Azure Digital Twins service. Meter ID
BillingMessagesProcessed Billing Messages Processed Count Total Billing metric for the number of messages sent out from Azure Digital Twins to external endpoints.

To be considered a single message for billing purposes, a payload must be no larger than 1 KB. Payloads larger than this limit will be counted as additional messages in 1 KB increments (so a message between 1 KB and 2 KB will be counted as 2 messages, between 2 KB and 3 KB will be 3 messages, and so on).
This restriction also applies to responses—so a call that returns 1.5 KB in the response body, for example, will be billed as 2 operations.
Meter ID
BillingQueryUnits Billing Query Units Count Total The number of Query Units, an internally computed measure of service resource usage, consumed to execute queries. There's also a helper API available for measuring Query Units: QueryChargeHelper Class Meter ID

For more information on the way Azure Digital Twins is billed, see Azure Digital Twins pricing.

Ingress metrics

Metrics having to do with data ingress:

Metric Metric display name Unit Aggregation type Description Dimensions
IngressEvents Ingress Events Count Total The number of incoming telemetry events into Azure Digital Twins. Result
IngressEventsFailureRate Ingress Events Failure Rate Percent Average The percentage of incoming telemetry events for which the service returns an internal error (500) response code. Result
IngressEventsLatency Ingress Events Latency Milliseconds Average The time from when an event arrives to when it's ready to be egressed by Azure Digital Twins, at which point the service sends a success/fail result. Result

Routing metrics

Metrics having to do with routing:

Metric Metric display name Unit Aggregation type Description Dimensions
MessagesRouted Messages Routed Count Total The number of messages routed to an endpoint Azure service such as Event Hubs, Service Bus, or Event Grid. Endpoint Type,
Result
RoutingFailureRate Routing Failure Rate Percent Average The percentage of events that result in an error as they're routed from Azure Digital Twins to an endpoint Azure service such as Event Hubs, Service Bus, or Event Grid. Endpoint Type,
Result
RoutingLatency Routing Latency Milliseconds Average Time elapsed between an event getting routed from Azure Digital Twins to when it's posted to the endpoint Azure service such as Event Hubs, Service Bus, or Event Grid. Endpoint Type,
Result

Dimensions

Dimensions help identify more details about the metrics. Some of the routing metrics provide information per endpoint. The table below lists possible values for these dimensions.

Dimension Values
Authentication OAuth
Operation (for API Requests) Microsoft.DigitalTwins/digitaltwins/delete,
Microsoft.DigitalTwins/digitaltwins/write,
Microsoft.DigitalTwins/digitaltwins/read,
Microsoft.DigitalTwins/eventroutes/read,
Microsoft.DigitalTwins/eventroutes/write,
Microsoft.DigitalTwins/eventroutes/delete,
Microsoft.DigitalTwins/models/read,
Microsoft.DigitalTwins/models/write,
Microsoft.DigitalTwins/models/delete,
Microsoft.DigitalTwins/query/action
Endpoint Type Event Grid,
Event Hubs,
Service Bus
Protocol HTTPS
Result Success,
Failure
Status Code 200, 404, 500, and so on.
Status Code Class 2xx, 4xx, 5xx, and so on.
Status Text Internal Server Error, Not Found, and so on.

Next steps

To learn more about managing recorded metrics for Azure Digital Twins, see Monitor with diagnostics logs.