Skip to content

cloud/064-bstack-cli#2351

Merged
isaiahb merged 18 commits intodevfrom
cloud/064-bstack-cli
Mar 29, 2026
Merged

cloud/064-bstack-cli#2351
isaiahb merged 18 commits intodevfrom
cloud/064-bstack-cli

Conversation

@isaiahb
Copy link
Copy Markdown
Contributor

@isaiahb isaiahb commented Mar 28, 2026

No description provided.

isaiahb added 4 commits March 28, 2026 14:49
New CLI tool at cloud/tools/bstack/ for instant production diagnostics:
- bstack health: all-region health check with uptime monitors
- bstack diagnostics: GC probes, event loop gaps, MongoDB, operation budget
- bstack crash-timeline: what happened before a crash
- bstack memory: RSS trend with growth rate and time-to-crash estimate
- bstack gc/gaps/budget/slow-queries/cache: focused analysis per feature
- bstack incidents: recent uptime incidents
- bstack sources: list all BetterStack resources
- bstack sql: raw ClickHouse SQL queries

config.ts: complete inventory of all BetterStack source IDs, collector IDs,
dashboard IDs, uptime monitors, region configs, and diagnostic features.

Usage: cd cloud/tools/bstack && bun run bstack.ts <command>
Requires: BETTERSTACK_USERNAME, BETTERSTACK_PASSWORD, BETTERSTACK_API_TOKEN

Issue: cloud/issues/064-bstack-cli/spike.md
…27-28

12 open items tracked:
- Cloudflare LB wrong domain (mobile uses mentra.glass, LB config on mentraglass.com)
- France/East Asia need redeploy for new BetterStack source
- MongoDB users.findOne 3.4s spike (definitive event loop gap cause)
- SDK auth still hits DB (intentional tradeoff)
- Bun runtime memory issues (known, monitoring)
- MongoDB callback storm theory (needs proof)
- Per-region uptime monitors (not set up)
- Dashboard alerts (not set up)
- Multi-region dashboards (only US Central)
- Mobile reconnect improvements
- MEMORY_TELEMETRY_ENABLED still not flipped
- Cherry-pick hotfixes into dev

Plus complete inventory of what was shipped and tools available.
@isaiahb isaiahb self-assigned this Mar 28, 2026
@isaiahb isaiahb requested a review from a team as a code owner March 28, 2026 23:10
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 28, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 27b7afe2-f80e-4f4c-9979-241d506b2269

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cloud/064-bstack-cli

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

📋 PR Review Helper

📱 Mobile App Build

Waiting for build...

🕶️ ASG Client Build

Waiting for build...


🔀 Test Locally

gh pr checkout 2351

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ea76b518d3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +366 to +369
if (!API_TOKEN) {
console.error("❌ BETTERSTACK_API_TOKEN not set.");
console.error(" This is the management API token from BetterStack → Integrations → API.");
process.exit(1);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid exiting process when uptime token is missing

cmdHealth wraps uptime monitor fetching in try/catch and prints a fallback message, but validateApiToken() calls process.exit(1) directly, so the catch path is never reached. This makes bstack health terminate with a non-zero exit whenever BETTERSTACK_API_TOKEN is unset, even though region health checks already completed and the code intends monitor fetching to be optional.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 407bb40. validateApiToken() now throws an error instead of calling process.exit(1). cmdHealth checks API_TOKEN before calling fetchUptime() and prints a fallback message if it's not set, so region health checks still complete successfully.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Mar 29, 2026

Deploying mentra-live-ota-site with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4b5d6fc
Status: ✅  Deploy successful!
Preview URL: https://c25af164.mentra-live-ota-site.pages.dev
Branch Preview URL: https://cloud-064-bstack-cli.mentra-live-ota-site.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying mentra-store-dev with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4b5d6fc
Status: ✅  Deploy successful!
Preview URL: https://5c4bae06.augmentos-appstore-2.pages.dev
Branch Preview URL: https://cloud-064-bstack-cli.augmentos-appstore-2.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying dev-augmentos-console with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4b5d6fc
Status: ✅  Deploy successful!
Preview URL: https://c75175dc.dev-augmentos-console.pages.dev
Branch Preview URL: https://cloud-064-bstack-cli.dev-augmentos-console.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying prod-augmentos-account with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4b5d6fc
Status: ✅  Deploy successful!
Preview URL: https://679d2751.augmentos-e84.pages.dev
Branch Preview URL: https://cloud-064-bstack-cli.augmentos-e84.pages.dev

View logs

@isaiahb isaiahb merged commit 6fe12d6 into dev Mar 29, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant