title | summary | toc |
---|---|---|
cockroach statement-diag |
Use statement-diag to manage and download statement diagnostics bundles. |
true |
The cockroach statement-diag
command can be used to manage and download statement diagnostics bundles generated from the DB Console or EXPLAIN ANALYZE (DEBUG)
.
Only members of the admin
role can run cockroach statement-diag
. By default, the root
user belongs to the admin
role.
Subcommand | Usage |
---|---|
list |
List available statement diagnostics bundles and outstanding activation requests. |
download |
Download a specified diagnostics bundle into a .zip file. |
delete |
Delete a statement diagnostics bundle(s). |
cancel |
Cancel an outstanding activation request(s). |
List available statement diagnostics bundles and outstanding activation requests:
$ cockroach statement-diag list <flags>
Download a specified diagnostics bundle into a .zip
file:
$ cockroach statement-diag download <diagnostics ID> <bundle filename> <flags>
Delete a statement diagnostics bundle:
$ cockroach statement-diag delete <diagnostics ID> <flags>
Delete all statement diagnostics bundles:
$ cockroach statement-diag delete --all <flags>
Cancel an outstanding activation request:
$ cockroach statement-diag cancel <diagnostics ID> <flags>
Cancel all outstanding activation requests:
$ cockroach statement-diag cancel --all <flags>
- The
delete
andcancel
subcommands support one general-use flag. - All
statement-diag
subcommands support several client connection and logging flags.
Flag | Description |
---|---|
--all |
Apply to all bundles or activation requests. |
{% include {{ page.version.version }}/sql/connection-parameters.md %}
See Client Connection Parameters for more details.
{% include {{ page.version.version }}/misc/logging-defaults.md %}
These examples assume you are running an insecure cluster and have requested and/or generated statement diagnostics bundles using the DB Console or EXPLAIN ANALYZE (DEBUG)
.
List statement diagnostics bundles and/or activation requests:
{% include copy-clipboard.html %}
$ cockroach statement-diag list --insecure
Statement diagnostics bundles:
ID Collection time Statement
603820372518502401 2020-11-02 18:29:13 UTC CREATE DATABASE bank
Outstanding activation requests:
ID Activation time Statement
603811900498804737 2020-11-02 17:46:08 UTC SELECT * FROM bank.accounts
Download a statement diagnostics bundle to bundle.zip
:
$ cockroach statement-diag download 603820372518502401 bundle.zip --insecure
Delete all statement diagnostics bundles:
$ cockroach statement-diag delete --all --insecure
List statement diagnostics bundles and/or activation requests:
{% include copy-clipboard.html %}
$ cockroach statement-diag list --insecure
Outstanding activation requests:
ID Activation time Statement
603811900498804737 2020-11-02 17:46:08 UTC SELECT * FROM bank.accounts
Delete an activation request:
$ cockroach statement-diag cancel 603811900498804737 --insecure