Azure Cosmos DB (Document DB) monitoring integration (deprecated)

The metrics in this document have been deprecated and are no longer supported by Microsoft Azure. Please refer to the Cosmos DB metrics currently supported by Microsoft.

For current users, both the deprecated and currently supported events, metrics, and accompanying metadata are included in the following content. Please use this as a reference to migrate your alert conditions and custom dashboards from the deprecated metrics to their supported counterparts, as the deprecated metrics may stop working without notice should Microsoft stop publishing them.

DEPRECATED

Access to this feature depends on your subscription level. Requires Infrastructure Pro.

New Relic Infrastructure provides an integration for Microsoft Azure's Cosmos DB service that reports your Cosmos DB metrics and inventory data to New Relic products. This document explains how to activate the Cosmos DB integration and describes the data that can be captured.

Features

New Relic Infrastructure gathers both database data and collection billing data from your Azure Cosmos DB service. You can monitor and alert on your Azure Cosmos DB data from New Relic Infrastructure, and you can create custom queries and custom chart dashboards in New Relic Insights.

Requirements

Requirements include:

Activate integration

To enable this integration:

  1. Make sure you have installed the Infrastructure agent before you activate Azure integrations from your Infrastructure account.
  2. Follow standard procedures to activate your Azure service in New Relic Infrastructure.

The Cosmos DB integration requires you to create an additional role and permission to fetch database and collection data:

  1. Go to the Azure Portal and open a shell by selecting the terminal [terminal icon] icon.
  2. Add the following command:

    az role definition create --role-definition '{
      "Name": "NewRelic Integrations",
      "Actions": [
        "*/read",
        "Microsoft.DocumentDB/databaseAccounts/listKeys/action"
      ],
      "NotActions": [],
      "AssignableScopes": [
        "/subscriptions/YOUR_INSERT_SUBSCRIPTION_ID"
      ],
      "Description": "Read Only for NewRelic Integrations",
      "IsCustom": "true"
    }'
  3. From Services > Subscriptions, select the subscription, go to Access control (IAM), and then select plus Add.
  4. In the Role search box, add the name of the newly created role definition (for example, NewRelic Integrations).
  5. In the Select search box, add the name of the New Relic integration application, and select it.
  6. Ensure that the application is added to the Selected members list, then Save.

Configuration and polling

You can change the polling frequency and filter data using configuration options.

Default polling information for the Cosmos DB integration:

  • Polling interval: 5 minutes
  • Resolution: 1 minute

Find and use data

To find your integration data in Infrastructure, go to infrastructure.newrelic.com > Integrations and look for the integration.

In New Relic Insights, data is organized like this:

Data Description
Event type
  • AzureCosmosDbAccountSample: about the Cosmos DB account
  • AzureCosmosDbDatabaseSample: about the database
  • AzureCosmosDbCollectionSample: about the collection
provider value
  • AzureCosmosDbAccount: about the DB Account
  • AzureCosmosDbDatabase: about the database
  • AzureCosmosDbCollection: about the collection

For more on how to find and use data, see Understand and use integration data.

Metric data

The metrics documented below have been deprecated and are no longer supported by Microsoft Azure. Please refer to the Cosmos DB metrics currently supported by Microsoft.

For current users, both the deprecated and currently supported events, metrics, and accompanying metadata are included in the following content. Please use this as a reference to migrate your alert conditions and custom dashboards from the deprecated metrics to their supported counterparts, as the deprecated metrics may stop working without notice should Microsoft stop publishing them.

Here are the metrics reported by the Cosmos DB integration. For more about how data is structured and reported to New Relic, see Understand and use integration data.

Metric (deprecated) Description Metric (supported)
availableStorageBytes

Total available storage capacity in bytes, per account.

availableStorageBytes
averageRequestsPerSecond

Average number of requests per second, per account.

metadataRequests.Average
consistencyLevelPercent

Percent of requests that meet the SLA, per collection.

N/A
dataSizeBytes

Total data size in bytes, per account.

dataUsageBytes
documentCount

Total number of documents, per account.

documentCount
http2xx

Total count of HTTP 2xx responses.

totalRequests, specifying statusCode metadata
http3xx

Total count of HTTP 3xx responses.

totalRequests, specifying statusCode metadata
http400

Total count of HTTP 400 responses.

totalRequests, specifying statusCode metadata
http401

Total count of HTTP 401 responses.

totalRequests, specifying statusCode metadata
indexSizeBytes

Total index size in bytes, per Account.

indexUsageBytes
internalServerError

Total count of internal server error codes.

totalRequests, specifying statusCode metadata
maxRequestUnitsPerSecond

Maximum RUs consumed per second, per account.

totalRequestUnits
mongoQueryRequestCharge

Total request units (RU) consumed on query operations (MongoDB only).

mongoRequestCharge, specifying commandName metadata
mongoUpdateRequestCharge

Total RU consumed on update operations (MongoDB only).

mongoRequestCharge, specifying commandName metadata
mongoDeleteRequestCharge

Total RU consumed on delete operations (MongoDB only).

mongoRequestCharge, specifying commandName metadata
mongoInsertRequestCharge

Total RU consumed on insert operations (MongoDB only).

mongoRequestCharge, specifying commandName metadata
mongoCountRequestCharge

Total RU consumed on count operations (MongoDB only).

mongoRequestCharge, specifying commandName metadata
mongoOtherRequestCharge

Total RU consumed on other operations (MongoDB only).

mongoRequestCharge, specifying commandName metadata
mongoQueryRequestRate

Total number of query operations, per account or collection (MongoDB only).

mongoRequests, specifying commandName metadata
mongoUpdateRequestRate

Total number of update operations, per account or collection (MongoDB only).

mongoRequests, specifying commandName metadata
mongoDeleteRequestRate

Total number of delete operations, per account or collection (MongoDB only).

mongoRequests, specifying commandName metadata
mongoInsertRequestRate

Total number of insert operations, per account or collection (MongoDB only).

mongoRequests, specifying commandName metadata
mongoCountRequestRate

Total number of count operations, per account or collection (MongoDB only).

mongoRequests, specifying commandName metadata
mongoOtherRequestRate

Total number of other requests, per account or collection (MongoDB only).

mongoRequests, specifying commandName metadata
mongoQueryFailedRequests

Total number of failed query operations, per ]account or collection (MongoDB only).

mongoRequests, specifying commandName and errorCode metadata
mongoUpdateFailedRequests

Total number of failed query operations, per account or collection (MongoDB only).

mongoRequests, specifying commandName and errorCode metadata
mongoDeleteFailedRequests

Total number of failed delete operations, per account or collection (MongoDB only).

mongoRequests, specifying commandName and errorCode metadata
mongoInsertFailedRequests

Total number of failed Insert operations, per account or collection (MongoDB only).

mongoRequests, specifying commandName and errorCode metadata
mongoCountFailedRequests

Total number of failed count operations, per account or collection (MongoDB only).

mongoRequests, specifying commandName and errorCode metadata
mongoOtherFailedRequests

Total number of failed other operations, per account or collection (MongoDB only).

mongoRequests, specifying commandName and errorCode metadata
observedReadLatencyMilliseconds

99th percentile of the average observed latencies for document lookup operations, in milliseconds.

N/A
observedWriteLatencyMilliseconds

99th percentile of the average observed latencies for document write operations, in milliseconds.

N/A
serviceAvailabilityPercent

Average percentage of successful requests as defined in the SLA, per collection (or database).

serviceAvailabilityPercent
serviceUnavailable

Total count of service unavailable codes.

totalRequests, specifying statusCode metadata
storageCapacityBytes

Total storage capacity in bytes, per account.

documentQuotaBytes
throttledRequests

Total number of requests failed due to throttling (throughput or storage), per collection.

totalRequests, specifying statusCode metadata
totalRequests

Total number of requests, per account.

totalRequests
totalRequestUnits

Total RUs consumed, per account.

totalRequestUnits

Inventory data

Inventory data is information about your system's state and configuration. For details on how to find and use inventory data, see Understand and use data.

The Cosmos DB integration reports this inventory data:

Inventory category Data reported
Account

documentEndpoint

databaseAccountOfferType

consistencyPolicy

defaultConsistencyLevel

resourceGroupName

type

regionName

Database

account

name

Collection

account

database

name

For more help