Integrate TiDB Cloud with Datadog (Beta)
TiDB Cloud supports Datadog integration (beta). You can configure TiDB Cloud to send metric data about your TiDB clusters to Datadog. After that, you can view these metrics in your Datadog dashboards directly.
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 edit third-party integration settings of TiDB Cloud, you must have the
Organization Owner
access to your organization orProject Member
access to the target project in TiDB Cloud.
Limitation
You cannot use the Datadog integration in TiDB Cloud Serverless clusters.
Datadog integrations are not available when the cluster status is CREATING, RESTORING, PAUSED, or RESUMING.
Steps
Step 1. Integrate with your Datadog API Key
Log in to the TiDB Cloud console.
Click in the lower-left corner, switch to the target project if you have multiple projects, and then click Project Settings.
On the Project Settings page of your project, click Integrations in the left navigation pane, and then click Integration to Datadog (BETA).
Enter your API key of Datadog and choose the site of Datadog.
Click Test Integration.
- If the test successes, 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 (https://app.datadoghq.com/account/settings#integrations/tidb-cloud) in Datadog.
- In the Configuration tab, click Install Integration. The TiDBCloud Cluster Overview dashboard is displayed in your Dashboard List.
Pre-built dashboard
Click the Dashboard link in the Datadog card of the integrations. You can see the pre-built dashboard of your TiDB clusters.
Metrics available to Datadog
Datadog tracks the following metric data 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, which is counted according to SELECT, INSERT, UPDATE, and other types of statements. |
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. |