Blip Docs
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

size.database

The size.database domain includes metrics about database sizes.

Usage

Database size is calculated as:

SELECT
  table_schema AS db,
  SUM(data_length + index_length) AS bytes
FROM
  information_schema.tables
WHERE
  /* include or exclude list */
GROUP BY 1

Database size includes all secondary indexes.

Reported table size and size on disk can vary due to several factors.

Since database sizes aren’t expected to have large and rapid changes, best practice is to collect this domain infrequently: 5, 10, 15, 30, or 60 minutes.

Derived Metrics

bytes

Metric Typegauge
Value Unitsbytes

Database size in bytes.

Options

exclude

Value TypeCSV string of db.table
Defaultmysql,information_schema,performance_schema,sys

A comma-separated list of database or table names to exclude (ignored if include is set).

include

Value TypeCSV string of db.table
Default

A comma-separated list of database or table names to include (overrides option exclude).

like

ValueDefaultDescription
yesUse LIKE pattern matching for include and exclude
noUse literal database names

If enabled (like = yes), the query becomes (table_schema LIKE 'foo') OR (table_schema LIKE 'bar'), where “foo” and “bar” are the included or excluded database names and can contain wildcards like %. Else, the query becomes table_schema IN ('foo', 'bar').

total

ValueDefaultDescription
yesReport size of all tables combined
noOnly report tables individually

Group Keys

KeyValue
dbDatabase name, or empty string for all databases

Meta

None.

Error Policies

None.

MySQL Config

None.

Changelog

Blip VersionChange
v1.0.0Domain added