cockroach
cockroach copied to clipboard
pkg/cli: add new sub-command "upload" to "debug zip"
This commit adds a new sub-command to the "debug zip" command called "upload". This gives cockroach CLI the ability to upload the contents of debug.zip to datadog (or any other observability tool in the future). This is an important step in consolidating the tools used for debugging issues in self-hosted clusters.
As of this commit, the "upload" command is capable of uploading the .pprof files captured for each node. They are usually found in the path: nodes/*/*.pprof. This command takes the datadog API key and the path to the directory containing the unzipped contents of the debug.zip as mandatory args.
Future commit will incrementally add the capability to upload more artefacts from the debug.zip. Adding support for a new artefact should be as simple as adding a new handler function to the uploadZipArtifactFuncs registry.
Usage
$ cockroach debug zip upload /tmp/debug --dd-api-key=XXXX --tags="customer:ABC,cluster:prod"
Screenshots
Command output
Datadog
Epic: CC-27712 Part of: CC-28674 Release note: None
TFTR! Will go ahead an merge for now. Merging this will give me a good framework to work on log upload. Minor tweaks can be done in future PRs. This is not a user facing command (hidden in the help text).
bors r+