Skip to content

Datadog integration

Push usage and performance metrics about your PlanetScale databases to Datadog.

PlanetScale can push metrics to Datadog to assist your team with understanding your database usage and performance.

Prerequisites

Configuring the Datadog integration

  1. In Datadog, install the PlanetScale integration.
  2. Create a Datadog API key in your Datadog Organization Settings and copy the key.
  3. 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 nameMetric typeDescription
planetscale.connectionsgaugeNumber of active connections to a database branch. Shown as connection.
planetscale.primary.cpu_usagegaugePercentage of CPU utilized on a database branch's primary. Shown as percent.
planetscale.primary.memory_usagegaugePercentage of memory utilized on a database branch's primary. Shown as percent.
planetscale.queries.latencygaugeQuery times in the p50, p95, p99 and p999 percentiles. Shown as second.
planetscale.replication_laggaugeReplication lag in seconds between a database branch's primary and each replica. Shown as second.
planetscale.rows_readcountNumber of rows read from a database branch. Shown as row.
planetscale.rows_writtencountNumber of rows written to a database branch. Shown as row.
planetscale.tables.cumulative_query_timecountCumulative active query time in a database branch, by table and statement. Shown as nanosecond.
planetscale.tables.queriescountNumber of queries issued to a database branch, by table and statement. Shown as query.
planetscale.tables.rows_deletedcountNumber of rows deleted from a database branch, by table. Shown as row.
planetscale.tables.rows_insertedcountNumber of rows inserted into a database branch, by table. Shown as row.
planetscale.tables.rows_selectedcountNumber of rows selected in a database branch, by table. Shown as row.
planetscale.tables.rows_updatedcountNumber of rows updated in a database branch, by table. Shown as row.
planetscale.tables.storagegaugeTotal bytes stored in a database branch, by table. Shown as byte.
planetscale.vtgate.errorscountNumber of errors encountered by a database branch's vtgate. Shown as error.

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.

Was this page useful?
Last updated on Help us improve this page