Skip to content

fix(obs): cost-roll gets an HTTP client and an honest staleness read (#1339) - #1341

Merged
athvin merged 1 commit into
mainfrom
fix/667-aws-http-client
Nov 28, 2026
Merged

athvin merged 1 commit into
mainfrom
fix/667-aws-http-client

Conversation

@athvin

@athvin athvin commented Nov 28, 2026 •

Copy link
Copy Markdown
Owner

Closes #1339

Post-merge is part of this pull request. The ledger below records whether
the follow-up work actually happened. /land-pr closes it.

cost_aws.rs builds the SDK config with an explicit Ring-backed rustls HTTP client (as exports.rs does), and CUR staleness reads the newest hourly Usage line's start.

Fix-forward from #1332 (#667), found by its first live run on dev: every Athena call failed "No HTTP client was available" (the AWS crates are default-features = false), and max(line_item_usage_end_date) is the month's end for monthly lines, so the CUR would always read fresh.

Proof

  • The failure: kubectl -n ci create job --from=cronjob/er-cost-roll → athena start: dispatch failure … No HTTP client was available.
  • The fix, probed against the live CUR with the er-builder profile: latest_usage_end → 2026-11-27T14:00:00Z (was 2026-12-01T00:00:00Z), instance_costs("2026-11", ["i-0851a55f0c462da5f"]) → $12.35.
  • make check exit 0.

Risk & rollback

Only the cost roll-up's AWS client. git revert <merge-sha>.

Post-merge ledger

Closed by: agent · session Claude Code:24d16c2e-fec6-49d8-9797-060338df4848 on Mac · 2026-11-28T21:35:11Z

  • main is green with this change on it — the merge SHA, and the run
    that proves it. A later head SHA with this commit as an ancestor counts;
    a cancelled run with zero jobs does not: — 67b16ba, rust 46154643020 + frontend 46154643033 success
  • images built, or correctly never ran because nothing that goes into
    an image changed: — success, run 46154643127
  • deploy converged — proved by a line the running process emitted, not
    by the image digest and not by the workflow conclusion: — run 46154937065 success; the running image's cost roll succeeded live (below)
  • the push-only surface no pull request can pre-test (deploy, drift,
    kind's nightly leg) is green, or knowingly red for a reason that is not
    this change: — infra, devcontainer success on 67b16ba
  • the board card reached Done through the automation rather than by
    hand, and the issue closed: — cost-roll: no HTTP client for the AWS SDKs; staleness read the month's end #1339 CLOSED by fix(obs): cost-roll gets an HTTP client and an honest staleness read (#1339) #1341 via automation
  • follow-ups are open for everything deferred here — numbers: — none
  • what was learned is written down where the next session will find it
    (a skill, a reference, memory) — or nothing new was learned: — probe an AWS client with a real call before merge; the er-builder profile can reach Athena for this

Specific to this change

  • a manual er-cost-roll run on dev succeeds after the deploy — er-cost-roll-verify-2 Complete, cur_staleness_hours 16.53
Context — plan, discoveries, measurements, files

Plan

Discoveries

  • A unit test cannot catch a missing HTTP client: only a live call does. The ledger item above is that live call.

Measurements

Files

🤖 Generated with Claude Code

…1339)

The first live run of er-cost-roll failed every Athena call with "No HTTP
client was available": the AWS crates are built default-features = false,
which drops the default client, and cost_aws.rs did not supply one the way
exports.rs and mail.rs do. It now builds the same Ring-backed rustls client.

CurStalenessHours read max(line_item_usage_end_date), which is the month's
end for monthly line items (2026-12-01 on 2026-11-27), so the CUR would
always look fresh. It now reads the newest hourly Usage line's start.

Probed against the live CUR with the er-builder profile: latest usage
2026-11-27T14:00Z, and a real instance cost returned.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@athvin
athvin merged commit 67b16ba into main Nov 28, 2026
40 checks passed
@athvin
athvin temporarily deployed to marketing-preview November 28, 2026 14:26 — with GitHub Actions Inactive

This branch was previously deployed

1 inactive deployment
marketing-preview — 983eabc3 Deployed Nov 28, 2026 by athvin via remove closed PR previews #118
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.

cost-roll: no HTTP client for the AWS SDKs; staleness read the month's end

2 participants