Skip to content

Add dartboard summarize subcommand#157

Merged
MSpencer87 merged 9 commits intorancher:mainfrom
MSpencer87:feature-summarize
Apr 2, 2026
Merged

Add dartboard summarize subcommand#157
MSpencer87 merged 9 commits intorancher:mainfrom
MSpencer87:feature-summarize

Conversation

@MSpencer87
Copy link
Copy Markdown
Contributor

Implements the dartboard summarize CLI subcommand used to gather:

  • Metrics
  • Profiles
  • Resource Counts

PR for #116

Please review carefully. Copilot and Gemini were used to assist with bash script conversions

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements a new dartboard summarize CLI subcommand that gathers metrics, profiles, and resource counts from deployed clusters. The implementation includes three standalone Go tools (collect-profile, export-metrics, and resource-counts) that are built and executed by the summarize command. The PR also adds functionality to update the monitoring project annotation during deployment.

Changes:

  • Added dartboard summarize subcommand to collect diagnostics from clusters
  • Implemented three new diagnostic tools in Go with corresponding build scripts
  • Updated deployment process to annotate cattle-monitoring-system namespace with project ID
  • Added unused GetProject function to kubectl package

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 24 comments.

Show a summary per file
File Description
cmd/dartboard/main.go Registers the new summarize subcommand
cmd/dartboard/subcommands/summarize.go Implements summarize logic: builds and runs diagnostic tools
cmd/dartboard/subcommands/deploy.go Adds updateMonitoringProject function to annotate monitoring namespace
internal/kubectl/kubectl.go Adds GetProject helper function (unused)
summarize-tools/collect-profile/* Go tool and build script for collecting heap/CPU profiles
summarize-tools/export-metrics/* Go tool, build script, and pod manifest for exporting Prometheus metrics
summarize-tools/resource-counts/* Go tool, build script, and legacy bash script for counting Kubernetes resources
.gitignore Adds patterns to ignore generated binaries and result directories

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Member

@git-ival git-ival left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @MSpencer87 👋
We should probably not have the different parts of summarize offload to separate module binaries. Can we refactor the collect-profile, export-metrics, and resource-counts modules into internal packages instead? Additionally, it would be good to have flags to optionally disable one or more of these when running dartboard summarize.

We can have separate module binaries for each of them, but the code providing the actual functionality should be contained within internal packages so that summarize and any other modules that need it can call the functions directly without relying on a separate binary.

@git-ival
Copy link
Copy Markdown
Member

git-ival commented Feb 5, 2026

We don't need to include all of these in this PR (we can iterate later), but I have some more notes after looking at this again:

  • Once this PR is merged, we will need to update the to-be-merged dartboard-choice jenkins job
  • We may want to make use of the standard tar package (https://pkg.go.dev/archive/tar)
  • Ideally the generated "summarize-results" directory would at least be prefixed with the tofu_workspace used in the dart file
    • It may even make sense to put the directory inside of the {terraform_workspace}_config/ directory that is generated by the tofu modules
  • Finally, it would be cool if copy/paste-able instructions for how to visualize/use the collected metrics and profiles was generated automatically and output to the std output
    • A very short how-to for importing the tsdb files into grafana/prometheus and viewing them
    • A very simple how-to for running go tool pprof with the different profiles

@MSpencer87 MSpencer87 force-pushed the feature-summarize branch 2 times, most recently from 4770704 to e49c287 Compare March 30, 2026 10:43
@MSpencer87
Copy link
Copy Markdown
Contributor Author

Following up this PR with Updates and improvements for summarize feature

@git-ival
Copy link
Copy Markdown
Member

@MSpencer87 Is this ready for a re-review?

@MSpencer87 MSpencer87 requested a review from git-ival April 2, 2026 12:37
@MSpencer87 MSpencer87 requested a review from git-ival April 2, 2026 20:08
Copy link
Copy Markdown
Member

@git-ival git-ival left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MSpencer87 MSpencer87 merged commit 143fb0f into rancher:main Apr 2, 2026
6 checks passed
@MSpencer87 MSpencer87 deleted the feature-summarize branch April 2, 2026 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants