Explore Azure Monitor Azure Cosmos DB insights

Azure Cosmos DB insights provides a view of the overall performance, failures, capacity, and operational health of all your Azure Cosmos DB resources in a unified interactive experience. This article helps you understand the benefits of this new monitoring experience, and how you can modify and adapt the experience to fit the unique needs of your organization.

Introduction

Before you begin, you should understand how information is presented and visualized.

It delivers:

  • At-scale perspective of your Azure Cosmos DB resources across all your subscriptions in a single location. You can selectively scope to only the subscriptions and resources that you're interested in evaluating.
  • Drill-down analysis of a particular Azure Cosmos DB resource. You can diagnose issues or perform detailed analysis by using the categories of utilization, failures, capacity, and operations. Selecting any one of the options provides an in-depth view of the relevant Azure Cosmos DB metrics.
  • Customizable experience built on top of Azure Monitor workbook templates. You can change what metrics are displayed, modify or set thresholds that align with your limits, and then save into a custom workbook. Charts in the workbooks can then be pinned to Azure dashboards.

This feature doesn't require you to enable or configure anything. These Azure Cosmos DB metrics are collected by default.

Note

There's no charge to access this feature. You'll only be charged for the Azure Monitor essential features you configure or enable, as described on the Azure Monitor pricing details page.

View insights from Azure portal

  1. Sign in to the Azure portal and navigate to your Azure Cosmos DB account.

  2. You can view your account metrics either from the Metrics pane or the Insights pane.

    • Metrics: This pane provides numerical metrics that are collected at regular intervals and describes some aspect of a system at a particular time. For example, you can view and monitor the server side latency metric, normalized request unit usage metric, etc.

    • Insights: This pane provides a customized monitoring experience for Azure Cosmos DB. Insights use the same metrics and logs that are collected in Azure Monitor and show an aggregated view for your account.

  3. Open the Insights pane. By default, the Insights pane shows the throughput, requests, storage, availability, latency, system, and management operations metrics for every container in your account. You can select the Time Range, Database, and Container for which you want to view insights. The Overview tab shows RU/s usage, data usage, index usage, throttled requests, and normalized RU/s consumption for the selected database and container.

    Screenshot of Azure Cosmos DB performance metrics in the Azure portal.

  4. The following metrics are available from the Insights pane:

    • Throughput. This tab shows the total number of request units consumed or failed (429 response code) because the throughput or storage capacity provisioned for the container has exceeded.

    • Requests. This tab shows the total number of requests processed by status code, by operation type, and the count of failed requests (429 response code). Requests fail when the throughput or storage capacity provisioned for the container exceeds.

    • Storage. This tab shows the size of data and index usage over the selected time period.

    • Availability. This tab shows the percentage of successful requests over the total requests per hour. The Azure Cosmos DB SLAs defines the success rate.

    • Latency. This tab shows the read and write latency observed by Azure Cosmos DB in the region where your account is operating. You can visualize latency across regions for a geo-replicated account. You can also view server-side latency by different operations. This metric doesn't represent the end-to-end request latency.

    • System. This tab shows how many metadata requests that the primary partition serves. It also helps to identify the throttled requests.

    • Management Operations. This tab shows the metrics for account management activities such as account creation, deletion, key updates, network and replication settings.

View utilization and performance metrics for Azure Cosmos DB

To view the utilization and performance of your storage accounts across all your subscriptions:

  1. Sign in to the Azure portal.

  2. Search for Monitor and select Monitor.

    Screenshot that shows the Search box with the word "Monitor" and a dropdown that says Services "Monitor" with a speedometer-style image.

  3. Select Azure Cosmos DB.

    Screenshot that shows the Azure Cosmos DB Overview workbook.

Overview

On the Overview page, the table displays interactive Azure Cosmos DB metrics. You can filter the results based on the options you select from the following dropdown lists:

  • Subscriptions: Only subscriptions that have an Azure Cosmos DB resource are listed.
  • Azure Cosmos DB: You can select all, a subset, or a single Azure Cosmos DB resource.
  • Time Range: By default, the last four hours of information are displayed based on the corresponding selections made.

The counter tile under the dropdown lists rolls up the total number of Azure Cosmos DB resources that are in the selected subscriptions. Conditional color-coding or heatmaps for columns in the workbook report transaction metrics. The deepest color has the highest value. A lighter color is based on the lowest values.

Select a dropdown arrow next to one of the Azure Cosmos DB resources to reveal a breakdown of the performance metrics at the individual database container level.

Screenshot that shows the Expanded dropdown that reveals individual database containers and associated performance breakdown.

Select the Azure Cosmos DB resource name highlighted in blue to go to the default Overview for the associated Azure Cosmos DB account.

Failures

Select the Failures tab to open the Failures portion of the workbook template. It shows you the total requests with the distribution of responses that make up those requests:

Screenshot that shows failures with breakdown by HTTP request type.

Code Description
200 OK One of the following REST operations were successful:
- GET on a resource.
- PUT on a resource.
- POST on a resource.
- POST on a stored procedure resource to execute the stored procedure.
201 Created A POST operation to create a resource is successful.
404 Not Found The operation is attempting to act on a resource that no longer exists. For example, the resource might have already been deleted.

For a full list of status codes, see HTTP status codes for Azure Cosmos DB.

Capacity

Select the Capacity tab to open the Capacity portion of the workbook template. It shows you:

  • How many documents you have.
  • Your document growth over time.
  • Data usage.
  • Total amount of available storage that you have left.

This information helps you to identify potential storage and data utilization issues.

Screenshot that shows the Capacity workbook.

As with the Overview workbook, selecting the dropdown next to an Azure Cosmos DB resource in the Subscription column reveals a breakdown by the individual containers that make up the database.

Operations

Select the Operations tab to open the Operations portion of the workbook template. You can see your requests broken down by the type of requests made.

In the following example, you see that eastus-billingint is predominantly receiving read requests, but with a few upsert and create requests. You can also see that westeurope-billingint is read-only from a request perspective, at least over the past four hours that the workbook is currently scoped to via its time range parameter.

Screenshot that shows the Operations workbook.

View from an Azure Cosmos DB resource

  1. Search for or select any of your existing Azure Cosmos DB accounts.

    Screenshot that shows searching for Azure Cosmos DB.

  2. After you've moved to your Azure Cosmos DB account, in the Monitoring section, select Insights (preview) or Workbooks. Now you can perform further analysis on throughput, requests, storage, availability, latency, system, and account management.

    Screenshot that shows the Azure Cosmos DB Insights Overview page.

Time range

By default, the Time Range field displays data from the last 24 hours. You can modify the time range to display data anywhere from the last 5 minutes to the last 7 days. The time range selector also includes a Custom mode. Enter the start/end dates to view a custom time frame based on available data for the selected account.

Screenshot that shows the Azure Cosmos DB Time Range.

Insights overview

The Overview tab provides the most common metrics for the selected Azure Cosmos DB account, including:

  • Total Requests
  • Failed Requests (429s)
  • Normalized RU Consumption (max)
  • Data & Index Usage
  • Azure Cosmos DB Account Metrics by Collection

Total Requests: This graph provides a view of the total requests for the account broken down by status code. The units at the bottom of the graph are a sum of the total requests for the period.

Screenshot that shows the Azure Cosmos DB Total Requests graph.

Failed Requests (429s): This graph provides a view of failed requests with a status code of 429. The units at the bottom of the graph are a sum of the total failed requests for the period.

Screenshot that shows the Azure Cosmos DB Failed Requests graph.

Normalized RU Consumption (max): This graph provides the maximum percentage between 0% and 100% of Normalized RU Consumption units for the specified period.

Screenshot that shows the Azure Cosmos DB Normalized RU Consumption graph.

Pin, export, and expand

You can pin any one of the metric sections to an Azure dashboard by selecting the pushpin in the upper-right corner of the section.

Screenshot that shows the metric section pin to dashboard example.

To export your data into the Excel format, select the down arrow to the left of the pushpin.

Screenshot that shows the Export workbook down arrow.

To expand or collapse all dropdown views in the workbook, select the expand arrow to the left of the down arrow.

Screenshot that shows the Expand workbook arrow.

Customize Azure Cosmos DB insights

This experience is built on top of Azure Monitor workbook templates. You can use Customize > Edit > Save to modify and save a copy of your modified version into a custom workbook.

Screenshot that shows the Customize button.

Workbooks are saved within a resource group. The My Reports section is private to you. The Shared Reports section is accessible to everyone with access to the resource group. After you save the custom workbook, you must go to the workbook gallery to start it.

Screenshot that shows the Gallery button.

Troubleshooting

For troubleshooting guidance, see Troubleshooting workbook-based insights.

Next steps