All blocks

Operations

Metrics

Metrics declared with defineMetric over a table (count, sum or avg per time bucket and dimension), rolled up into metric_points or read from the table, with metric_series and metric_value checked against a permission in the tenant.

DocsModes:managedadoptcustom
terminal
npx better-supabase sql add metrics
better-supabase.config.ts
import { defineConfig } from "better-supabase/config";

export default defineConfig({
  sql: {
    modules: {
      // Required by metrics; sql add installs them too.
      "updated-at": {},
      tenant: {},
      access: {},
      // Modes: "managed", "adopt", "custom". The default is "managed".
      metrics: { mode: "managed" },
    },
  },
});