Unkey

Quotacheck

Check for exceeded quotas

Check for exceeded quotas and optionally send Slack notifications.

This command monitors quota usage by querying ClickHouse for current usage metrics and comparing them against configured limits in the primary database. When quotas are exceeded, it can automatically send notifications via Slack webhook.

Configuration

The command requires ClickHouse and database connections to function. Slack notifications are optional but recommended for production monitoring.

Command Syntax

unkey quotacheck [flags]

Examples

Check quotas without notifications

unkey quotacheck --clickhouse-url clickhouse://localhost:9000 --database-dsn postgres://user:pass@localhost/db

Check quotas with Slack notifications

unkey quotacheck --clickhouse-url clickhouse://localhost:9000 --database-dsn postgres://user:pass@localhost/db --slack-webhook-url https://hooks.slack.com/services/...

Using environment variables

CLICKHOUSE_URL=... DATABASE_DSN=... SLACK_WEBHOOK_URL=... unkey quotacheck

Some flags are required for this command to work properly.

Flags

--clickhouse-url (required)

URL for the ClickHouse database

  • Type: string
  • Environment: CLICKHOUSE_URL

--database-dsn (required)

DSN for the primary database

  • Type: string
  • Environment: DATABASE_DSN

--slack-webhook-url

Slack webhook URL to send notifications

  • Type: string
  • Environment: SLACK_WEBHOOK_URL

On this page