Integrate TiDB Cloud with Datadog (Preview)
TiDB Cloud supports Datadog integration (Preview). You can configure TiDB Cloud to send metrics about your TiDB clusters to Datadog. After that, you can view these metrics in your Datadog dashboards directly.
Datadog integration version
TiDB Cloud has supported Datadog integration (Beta) since March 04, 2022. Starting from July 31, 2025, TiDB Cloud introduces an enhanced preview version of the integration.
- Datadog integration (Preview): if no Datadog or New Relic integration remains undeleted within your organization by July 31, 2025, TiDB Cloud provides the preview version of Datadog integration for your organization to experience the latest enhancements.
- Datadog integration (Beta): if at least one Datadog or New Relic integration remains undeleted within your organization by July 31, 2025, TiDB Cloud retains both existing and new integrations in the beta version to avoid affecting current dashboards. We will also proactively reach out to you to discuss a suitable migration plan and timeline.
Prerequisites
To integrate TiDB Cloud with Datadog, you must have a Datadog account and a Datadog API key. Datadog grants you an API key when you first create a Datadog account.
If you do not have a Datadog account, sign up at https://app.datadoghq.com/signup.
To set up third-party metrics integration for TiDB Cloud, you must have the
Organization Owner
orProject Owner
access in TiDB Cloud. To view the integration page or access configured dashboards via the provided links, you need at least theProject Viewer
role to access the target clusters under the project in TiDB Cloud.
Limitation
You cannot use the Datadog integration in TiDB Cloud Starter or TiDB Cloud Essential clusters.
Datadog integrations are not available when the cluster status is CREATING, RESTORING, PAUSED, or RESUMING.
When a cluster with Datadog integration is deleted, its associated integration services are also removed.
Steps
Step 1. Integrate with your Datadog API Key
Depending on your Datadog integration version, the steps to access the integration page are different.
- Datadog integration (Preview)
- Datadog integration (Beta)
In the TiDB Cloud console, navigate to the Clusters page of your project, and then click the name of your target cluster to go to its overview page.
In the left navigation pane, click Settings > Integrations.
On the Integrations page, click Integration to Datadog (PREVIEW).
Enter your Datadog API key and choose your Datadog site.
Click Test Integration.
- If the test succeeds, the Confirm button is displayed.
- If the test fails, an error message is displayed. Follow the message for troubleshooting and retry the integration.
Click Confirm to complete the integration.
In the TiDB Cloud console, switch to your target project using the combo box in the upper-left corner.
In the left navigation pane, click Project Settings > Integrations.
On the Integrations page, click Integration to Datadog (BETA).
Enter your Datadog API key and choose your Datadog site.
Click Test Integration.
- If the test succeeds, the Confirm button is displayed.
- If the test fails, an error message is displayed. Follow the message for troubleshooting and retry the integration.
Click Confirm to complete the integration.
Step 2. Install TiDB Cloud Integration in Datadog
Log in to Datadog.
Go to the TiDB Cloud Integration page in Datadog.
On the Configuration tab, click Install Integration.
- For Datadog integration (Preview), the TiDB Cloud Dynamic Tracker dashboard appears in your Dashboard List.
- For Datadog integration (Beta), the TiDB Cloud Cluster Overview dashboard appears in your Dashboard List.
View the pre-built dashboard
In the TiDB Cloud console, navigate to the Integrations page.
Click the Dashboard link in the Datadog section.
- For Datadog integration (Preview), the Dashboard link opens the new dashboard, which includes the latest metrics introduced in the preview version.
- For Datadog integration (Beta), the Dashboard link opens the legacy dashboard, which does not include the latest metrics introduced in the preview version.
Metrics available to Datadog
Datadog tracks the following metrics for your TiDB clusters.
Metric name | Metric type | Labels | Description |
---|---|---|---|
tidb_cloud.db_database_time | gauge | sql_type: Select|Insert|... cluster_name: <cluster name> instance: tidb-0|tidb-1… component: tidb | The total time consumed by all SQL statements running in TiDB per second, including the CPU time of all processes and the non-idle waiting time. |
tidb_cloud.db_query_per_second | gauge | type: Select|Insert|... cluster_name: <cluster name> instance: tidb-0|tidb-1… component: tidb | The number of SQL statements executed per second on all TiDB instances, counted by the statement type (SELECT , INSERT , or UPDATE ). |
tidb_cloud.db_average_query_duration | gauge | sql_type: Select|Insert|... cluster_name: <cluster name> instance: tidb-0|tidb-1… component: tidb | The duration between the time that the client's network request is sent to TiDB and the time that the request is returned to the client after TiDB has executed it. |
tidb_cloud.db_failed_queries | gauge | type: executor:xxxx|parser:xxxx|... cluster_name: <cluster name> instance: tidb-0|tidb-1… component: tidb | The statistics of error types (such as syntax errors and primary key conflicts) according to the SQL execution errors that occur per second on each TiDB instance. |
tidb_cloud.db_total_connection | gauge | cluster_name: <cluster name> instance: tidb-0|tidb-1… component: tidb | The number of current connections in your TiDB server. |
tidb_cloud.db_active_connections | gauge | cluster_name: <cluster name> instance: tidb-0|tidb-1… component: tidb | The number of active connections. |
tidb_cloud.db_disconnections | gauge | result: ok|error|undetermined cluster_name: <cluster name> instance: tidb-0|tidb-1… component: tidb | The number of disconnected clients. |
tidb_cloud.db_command_per_second | gauge | type: Query|StmtPrepare|... cluster_name: <cluster name> instance: tidb-0|tidb-1… component: tidb | The number of commands processed by TiDB per second, which is classified according to the success or failure of command execution results. |
tidb_cloud.db_queries_using_plan_cache_ops | gauge | cluster_name: <cluster name> instance: tidb-0|tidb-1… component: tidb | The statistics of queries using Plan Cache per second. The execution plan cache only supports the prepared statement command. |
tidb_cloud.db_transaction_per_second | gauge | txn_mode: pessimistic|optimistic type: abort|commit|... cluster_name: <cluster name> instance: tidb-0|tidb-1… component: tidb | The number of transactions executed per second. |
tidb_cloud.node_storage_used_bytes | gauge | cluster_name: <cluster name> instance: tikv-0|tikv-1…|tiflash-0|tiflash-1… component: tikv|tiflash | The disk usage of TiKV/TiFlash nodes, in bytes. |
tidb_cloud.node_storage_capacity_bytes | gauge | cluster_name: <cluster name> instance: tikv-0|tikv-1…|tiflash-0|tiflash-1… component: tikv|tiflash | The disk capacity of TiKV/TiFlash nodes, in bytes. |
tidb_cloud.node_cpu_seconds_total | count | cluster_name: <cluster name> instance: tidb-0|tidb-1…|tikv-0…|tiflash-0… component: tidb|tikv|tiflash | The CPU usage of TiDB/TiKV/TiFlash nodes. |
tidb_cloud.node_cpu_capacity_cores | gauge | cluster_name: <cluster name> instance: tidb-0|tidb-1…|tikv-0…|tiflash-0… component: tidb|tikv|tiflash | The limit on CPU cores of TiDB/TiKV/TiFlash nodes. |
tidb_cloud.node_memory_used_bytes | gauge | cluster_name: <cluster name> instance: tidb-0|tidb-1…|tikv-0…|tiflash-0… component: tidb|tikv|tiflash | The used memory of TiDB/TiKV/TiFlash nodes, in bytes. |
tidb_cloud.node_memory_capacity_bytes | gauge | cluster_name: <cluster name> instance: tidb-0|tidb-1…|tikv-0…|tiflash-0… component: tidb|tikv|tiflash | The memory capacity of TiDB/TiKV/TiFlash nodes, in bytes. |
For Datadog integration (Preview), the following additional metrics are also available:
Metric name | Metric type | Labels | Description |
---|---|---|---|
tidbcloud.node_storage_available_bytes | gauge | instance: tidb-0\|tidb-1\|... component: tikv\|tiflash cluster_name: <cluster name> | The available disk space in bytes for TiKV/TiFlash nodes. |
tidbcloud.disk_read_latency | gauge | instance: tidb-0\|tidb-1\|... component: tikv\|tiflash cluster_name: <cluster name> device : nvme.*\|dm.* | The read latency in seconds per storage device. |
tidbcloud.disk_write_latency | gauge | instance: tidb-0\|tidb-1\|... component: tikv\|tiflash cluster_name: <cluster name> device : nvme.*\|dm.* | The write latency in seconds per storage device. |
tidbcloud.kv_request_duration | histogram | instance: tidb-0\|tidb-1\|... component: tikv cluster_name: <cluster name> type : BatchGet\|Commit\|Prewrite\|... | The duration in seconds of TiKV requests by type. |
tidbcloud.component_uptime | gauge | instance: tidb-0\|tidb-1\|... component: tidb\|tikv\|tiflash cluster_name: <cluster name> | The uptime (in seconds) of TiDB components. |
tidbcloud.ticdc_owner_checkpoint_ts_lag | gauge | changefeed_id: <changefeed-id> cluster_name: <cluster name> | The checkpoint timestamp lag (in seconds) for changefeed owner. |
tidbcloud.ticdc_owner_resolved_ts_lag | gauge | changefeed_id: <changefeed-id> cluster_name: <cluster name> | The resolved timestamp lag (in seconds) for the changefeed owner. |
tidbcloud.changefeed_status | gauge | changefeed_id: <changefeed-id> cluster_name: <cluster name> | Changefeed status:-1 : Unknown0 : Normal1 : Warning2 : Failed3 : Stopped4 : Finished6 : Warning7 : Other |
tidbcloud.resource_manager_resource_unit_read_request_unit | gauge | cluster_name: <cluster name> resource_group: <group-name> | The read request units (RUs) consumed by Resource Manager. |
tidbcloud.resource_manager_resource_unit_write_request_unit | gauge | cluster_name: <cluster name> resource_group: <group-name> | The write request units (RUs) consumed by Resource Manager. |
tidb_cloud.dm_task_state | gauge | instance: instance task: task cluster_name: <cluster name> | Task State of Data Migration: 0: Invalid 1: New 2: Running 3: Paused 4: Stopped 5: Finished 15: Error |
tidb_cloud.dm_syncer_replication_lag_bucket | gauge | instance: instance cluster_name: <cluster name> | Replicate lag (bucket) of Data Migration. |
tidb_cloud.dm_syncer_replication_lag_gauge | gauge | instance: instance task: task cluster_name: <cluster name> | Replicate lag (gauge) of Data Migration. |
tidb_cloud.dm_relay_read_error_count | gauge | instance: instance cluster_name: <cluster name> | Fail to read binlog from master. |