Datadog integration
PlanetScale can push metrics to Datadog to assist your team with understanding your database usage and performance.
Prerequisites
- A Datadog account
Configuring the Datadog integration
- In Datadog, install the PlanetScale integration.
- Create a Datadog API key in your Datadog Organization Settings and copy the key.
- In PlanetScale, go to your organization's Integrations settings, and select Configure for the Datadog integration. Paste your Datadog API key into the field.
Once complete, a "PlanetScale" dashboard will be available with incoming metrics from PlanetScale.
Metrics We Collect
Once configured, PlanetScale collects the following metrics from every branch in your organization.
Metric name | Metric type | Description |
---|---|---|
planetscale.connections | gauge | Number of active connections to a database branch. Shown as connection. |
planetscale.primary.cpu_usage | gauge | Percentage of CPU utilized on a database branch's primary. Shown as percent. |
planetscale.primary.memory_usage | gauge | Percentage of memory utilized on a database branch's primary. Shown as percent. |
planetscale.queries.latency | gauge | Query times in the p50, p95, p99 and p999 percentiles. Shown as second. |
planetscale.replication_lag | gauge | Replication lag in seconds between a database branch's primary and each replica. Shown as second. |
planetscale.rows_read | count | Number of rows read from a database branch. Shown as row. |
planetscale.rows_written | count | Number of rows written to a database branch. Shown as row. |
planetscale.tables.cumulative_query_time | count | Cumulative active query time in a database branch, by table and statement. Shown as nanosecond. |
planetscale.tables.queries | count | Number of queries issued to a database branch, by table and statement. Shown as query. |
planetscale.tables.rows_deleted | count | Number of rows deleted from a database branch, by table. Shown as row. |
planetscale.tables.rows_inserted | count | Number of rows inserted into a database branch, by table. Shown as row. |
planetscale.tables.rows_selected | count | Number of rows selected in a database branch, by table. Shown as row. |
planetscale.tables.rows_updated | count | Number of rows updated in a database branch, by table. Shown as row. |
planetscale.tables.storage | gauge | Total bytes stored in a database branch, by table. Shown as byte. |
planetscale.vtgate.errors | count | Number of errors encountered by a database branch's vtgate. Shown as error. |
planetscale.vttablet.mem_util.max | gauge | Maximum memory utilization of a database branch's vttablet. Shown as percent. |
planetscale.vttablet.mem_util.avg | gauge | Average memory utilization of a database branch's vttablet. Shown as percent. |
planetscale.vttablet.iops | gauge | Number of IOPS performed by a database branch's vttablet. Shown as operation. |
Billing
The Datadog integration is available on all of our paid plans.
Frequently asked questions
How do I track replication lag in Datadog?
You can use the following formula to set alerts for replication lag:
(max:planetscale.replication_lag{ps_database:<DATABASE_NAME> ps_tablet_type:replica, ps_branch:<MAIN>})
Make sure you replace <DATABASE_NAME>
with your PlanetScale database name and <MAIN>
with the name of the branch for which you'd like to track replication lag.
Need help?
Get help from the PlanetScale Support team, or join our GitHub discussion board to see how others are using PlanetScale.