A command-line utility for exporting workload data from a CockroachDB cluster into a portable zip file for analysis.
This tool simplifies the process of exporting workload data for analysis, including:
- Statement and transaction statistics
- Contention events
- Cluster metadata, including node topology and configuration
- Table schemas
- Zone configurations
- System settings
Download the appropriate binary for your platform from the releases page.
# Clone the repository
git clone https://github.com/yourusername/workload-exporter.git
cd workload-exporter
# Build the binary
go build -o workload-exporter
Export workload data from a CockroachDB cluster to a zip file:
workload-exporter export \
-c "postgresql://user:password@host:26257/database?sslmode=verify-full" \
[options]
--connection-url
,-c
: Connection string for CockroachDB (required)--output-file
,-o
: Output zip file name (default: "workload-export.zip")--start
,-s
: start time (default: current time - 6 hours)--end
,-e
: End time (default: current time + 1 hour)
Export workload data:
# Export
workload-exporter export -c "postgresql://user:password@source-host:26257/?sslmode=verify-full"
Export for a specific time period:
# Export a specific time window
workload-exporter export -c "postgresql://user:password@host:26257/?sslmode=verify-full"
-s '2025-04-18T13:25:00Z'
-e '2025-04-18T20:25:00Z'
Export using a custom file:
workload-exporter export -c "postgresql://user:password@host:26257/?sslmode=verify-full"
-o 'my-export.zip'
The export zip file contains:
metadata.json
: Information about the export, including databases, tables, and configuration- One file per exported table in the format
[database].[table]
Requirements:
- Go 1.18 or later
# Get dependencies
go mod tidy
# Build
go build -o workload-exporter