Skip to content

chore(stats): retire the S3 data lake - #52514

Merged
adamdotdevin merged 1 commit into
devfrom
retire-s3-lake
Oct 1, 2026
Merged

adamdotdevin merged 1 commit into
devfrom
retire-s3-lake

Conversation

@adamdotdevin

@adamdotdevin adamdotdevin commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Summary

Stats sync has read from the R2 lake since 46a14e6, so this stops feeding and reading the old AWS S3 Tables lake ahead of deleting it.

  • Stop the Console log processor posting Zen events to the lake ingest service. Its console logging is unchanged, and the disabled Honeycomb export is kept.
  • Drop the legacy Athena link and IAM permissions from StatsSyncService, plus the unused Athena client and @aws-sdk/client-athena.
  • Make the remaining lake resources deletable in every stage: forceDestroy: true on the table bucket, both S3 buckets, and the Athena workgroup, and retainOnDelete: false on the two S3 buckets so production's removal: "retain" doesn't orphan them.

The ingest service keeps running for now because models.dev still posts to it, until anomalyco/models.dev#8550 moves those hits to the R2 lake.

Why two PRs

Pulumi reads forceDestroy and retainOnDelete from state when it deletes a resource. Both were off in production, so removing the lake in a single deploy would fail on the Athena workgroup (it still has query history) and leave the S3 buckets behind. These settings have to deploy to dev and production before #52515.

Rollout

  1. Merge and deploy this to dev, then production.
  2. Merge anomalyco/anomaly#674, then chore(function): send hits to the r2 data lake models.dev#8550, which sends models.hit events to the R2 lake and backfills the hits recorded here.
  3. chore(stats): retire legacy s3 lake #52515, which deletes the lake, is on hold. The inference and analytics dashboards in anomalyco/anomaly still read its history.

Validation

  • Typecheck: stats core, server, and app, and console function. Repository pre-push typecheck: 30 packages passed.
  • Stats app tests pass. Stats core has 5 failures in r2-sql.test.ts ("database is locked" when bun:sqlite disposes), a file this PR doesn't touch.
  • Built the stats-server image: the ingest server still boots (/health and /ready return 200) and stat-sync.ts bundles.

Stats sync reads from the R2 lake, so stop feeding and reading the old
AWS S3 Tables lake ahead of removing it:

- Stop the log processor posting Zen events to the lake ingest service.
- Drop the legacy Athena link and IAM permissions from stats sync, along
  with the unused Athena client.
- Make the remaining lake resources deletable in every stage
  (forceDestroy, and opt the S3 buckets out of SST's production retain
  policy).

Pulumi reads forceDestroy and retainOnDelete from state at delete time,
so this must deploy to dev and production before the lake resources are
removed from code.
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