Skip to main content
CostGraph connects to PlanetScale by signing in with PlanetScale, or with a service token you create. Either way, CostGraph can read your databases, their branch cluster sizes, invoices, and metrics endpoints, so it can attribute cost and recommend rightsizing for your managed databases.

Connect with PlanetScale

  1. Open Settings > Integrations and pick PlanetScale.
  2. Name the connection and pick the tenant these charges belong to.
  3. If your PlanetScale access covers more than one organization, enter the Organization to connect. Otherwise leave it empty. If it’s needed and missing, the connection fails and asks for it.
  4. Select Connect with PlanetScale, sign in if asked, and approve the access requested.
CostGraph asks for read-only access to your databases, invoices, and metrics. If the access is revoked in PlanetScale or expires, the connection shows Reconnect, which reopens the connect dialog. Connecting again updates the same connection.

Or paste a token instead

To use a service token, create one with the steps below, then select Or paste a token instead in the connect dialog.

Create a service token

  1. In the PlanetScale dashboard, open your organization’s Settings > Service tokens.
  2. Create a token and copy the token ID and token value. The value is shown once.
  3. Grant the token the accesses below.

Required accesses

Grant these at the organization level: Then grant this per database you want rightsized (Databases > Accesses on the service token):
read_branch is granted per database, not at the organization level. Without it, CostGraph still ingests inventory and billing, but database size and cost recommendations are disabled for that database. The connect screen warns you when the token is missing read_branch.

Connect with the token

  1. Open Settings > Integrations and pick PlanetScale.
  2. Select Or paste a token instead, or use the token form if it is already showing. Paste the token ID and token value, pick the tenant, and connect.
  3. If the token is missing read_branch, CostGraph accepts the connection and shows a warning. Grant the access in PlanetScale, then reconnect or wait for the next sync.

What CostGraph does with it

  • Inventory: databases, regions, and nodes.
  • Billing: real invoice line items, mapped to each database.
  • Sizing and cost: each node is matched to its pricing (size SKU, architecture, HA topology, region) so storage and replica recommendations show real dollar savings.