monitoring-background-jobs

Diagnose CockroachDB background job health using SHOW JOBS and SHOW AUTOMATIC JOBS.

18|8|Updated Feb 19, 2026
One-click install
npx skills add https://github.com/cockroachlabs/cockroachdb-skills --skill monitoring-background-jobs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: monitoring-background-jobs
Source: https://github.com/cockroachlabs/cockroachdb-skills/tree/main/skills/observability-and-diagnostics/monitoring-background-jobs
Command: npx skills add https://github.com/cockroachlabs/cockroachdb-skills --skill monitoring-background-jobs

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Monitors CockroachDB background job health by surfacing failed, paused, and long-running jobs using SHOW JOBS and SHOW AUTOMATIC JOBS. Surfaces schema changes, backups/restores, automatic statistics collection, and SQL stats compaction jobs without requiring DB Console access. Use when investigating schema change delays, failed backups, or automatic job issues.

Core Features & Use Cases

  • Detects issues across user-initiated and automatic background jobs (SCHEMA CHANGE, BACKUP, RESTORE, AUTO CREATE STATS, AUTO SQL STATS COMPACTION)
  • Provides guidance for live triage and historical analysis, including visibility into coordinator and running_status
  • Supports RBAC considerations (VIEWJOB for monitoring; CONTROLJOB for limited control)

Quick Start

To run a quick health check, query SHOW JOBS and SHOW AUTOMATIC JOBS to surface any failed, paused, or long-running background tasks.

Frequently Asked Questions about monitoring-background-jobs

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I monitor CockroachDB background jobs for health issues?

Monitor CockroachDB background jobs by querying SHOW JOBS and SHOW AUTOMATIC JOBS to surface failed, paused, or long-running tasks. This identifies issues across schema changes, backups, restores, and automatic statistics collection without needing DB Console access.

Why does my CockroachDB schema change show delays or stall?

CockroachDB schema change delays or stalls occur when background jobs fail or run too long. Querying SHOW JOBS surfaces the running_status and coordinator details to diagnose whether the schema change is paused or experiencing execution stalls.

What privileges are needed to triage CockroachDB automatic jobs?

Triageing CockroachDB automatic jobs requires VIEWJOB privileges for monitoring access, while CONTROLJOB privileges are necessary for limited control and escalation. These RBAC permissions ensure safe triage of automatic statistics collection and SQL stats compaction tasks.

Can I investigate failed CockroachDB backups without DB Console access?

Investigating failed CockroachDB backups without DB Console access is possible by running SHOW JOBS queries. This surfaces backup and restore job failures, pauses, and running_status details directly through SQL for live triage and historical analysis.

What is the best way to diagnose automatic statistics collection issues in CockroachDB?

Diagnosing automatic statistics collection issues in CockroachDB is best done by querying SHOW AUTOMATIC JOBS. This surfaces failures, pauses, and long-running tasks for AUTO CREATE STATS and AUTO SQL STATS COMPACTION to understand delays or stalls.