Skip to content

status: list every billable resource, not just the instance - #634

Merged
scttfrdmn merged 1 commit into
mainfrom
feat/615-status-billable-resources
Oct 2, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
feat/615-status-billable-resources

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Refs #615.

Process note: I first committed this straight to main (fd823ed) instead of opening a PR — my mistake, from checking out main for a clean base and forgetting to branch. main has been reverted (e9e26ae, no history rewrite) and this PR re-lands the same change through review. The content is unchanged.

The gap

spawn status reported the instance. A launch can also provision an FSx Lustre filesystem (1200 GiB minimum, ~$174/month), an EFS mount, and EBS volumes that keep billing while the instance is merely stopped. So the user's mental model of "what am I paying for" was built from a structurally incomplete view.

That is how #613 happened. The filesystem was the most expensive thing in the launch and the least visible thing in the tooling: --cost-limit is compute-only, --estimate-only didn't mention it, spawn terminate didn't mention it, and spawn status didn't either. Every surface a user would naturally check was silent about the single largest line item.

What it looks like

Billable resources:
  instance  i-abc                  ~$0.1700/hr              c5.xlarge
  ebs       —                      ~$0.0022/hr              root/data volumes
  fsx       fs-0d0d29cb9e4be40df   ~$174.00/month or more   size unknown; 1200 GiB minimum assumed, ephemeral
  ⚠️  --cost-limit caps COMPUTE only — the non-instance rows above are outside it.
      Rows marked as outliving the instance keep billing after it is gone:
      'spawn fsx list' / 'spawn orphans' to find them, and delete explicitly.

Design choices worth reviewing:

Also: retires a hedge #624 made stale

spawn status said the reaper was a backstop "if deployed for your account", and the comment justifying it claimed coverage was not detectable from a launch account — citing the hardcoded pkg/doctor stub that #624 replaced. Both were wrong. The line now points at spawn doctor, which answers it definitively, rather than making status pay for two AWS calls per invocation. (I'd rather fix a stale claim I created than leave it behind one PR later.)

Tests

Nine cases, all pure (no AWS): the FSx row names the filesystem, lifecycle and cost floor; stopped EBS is flagged while compute is not; an unpriced instance says so and never renders zero; a pending filesystem appears and is labelled provisioning; EFS states its billing basis rather than implying free; the block is silent for compute-only and for untagged/nil instances; Capped/OutlivesInstance are correct per kind (storage must not claim to be covered by --cost-limit — that's the #616 confusion); and parseTagFloat rejects junk and negatives.

Gates

gofmt · go vet · go build · go test ./... all green · make check-docs clean · staticcheck zero added (diffed by message).

Suggested bump: MINOR (new output section). #616 — making --cost-limit actually cover storage — remains the open behavioural question; this is the visibility half.

spawn status reported the instance and nothing else, while a launch can also
provision an FSx Lustre filesystem (1200 GiB minimum, ~$174/month), an EFS mount,
and EBS volumes that keep billing while the instance is merely stopped. So the user's
mental model of 'what am I paying for' was built from a structurally incomplete view.

That is how #613 happened: the filesystem was the most expensive thing in the launch
and the least visible thing in the tooling. --cost-limit is compute-only,
--estimate-only didn't mention it, terminate didn't mention it, and status didn't
either — every surface a user would naturally check was silent about the single
largest line item.

status now lists each billable resource with its rate, states explicitly that
--cost-limit caps COMPUTE only, and marks the rows that keep billing after the
instance is gone, with the commands to find and delete them. A stopped instance's EBS
is called out as STILL BILLING while the compute row says it is not — 'stopped to save
money' is the quietest form of the same surprise, and spored cannot act once stopped.

Rates come from the tags spawn already wrote (spawn:price-per-hour,
spawn:ebs-hourly-cost) rather than being re-derived, so this view cannot drift from
what --cost-limit is actually enforced against (#533). An unpriced instance reads
'rate unknown', never $0.00. A provisioning filesystem (spawn:fsx-pending) counts,
since that is the window #613 was reported from. The block is omitted entirely when
the instance is the only billable thing — status already says that, and a redundant
section is the noise that made the old reaper warning worthless.

Also retires a hedge my own #624 made stale: status said the reaper was a backstop
'if deployed for your account', and the comment justifying it claimed coverage was not
detectable from a launch account, citing the hardcoded pkg/doctor stub that #624
replaced. Both were wrong. The line now points at 'spawn doctor', which answers it,
rather than making status pay for two AWS calls per invocation.

Refs #615
@codecov

codecov Bot commented Oct 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.63636% with 10 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/status_billable.go 92.68% 3 Missing and 3 partials ⚠️
cmd/status.go 33.33% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

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