Skip to content

feat(web-analytics): warm audience percentage via dagster run config - #70544

Merged
lricoy merged 4 commits into
masterfrom
lricoy/wa-eager-warm-active-audience
Jul 13, 2026
Merged

feat(web-analytics): warm audience percentage via dagster run config#70544
lricoy merged 4 commits into
masterfrom
lricoy/wa-eager-warm-active-audience

Conversation

@lricoy

@lricoy lricoy commented Jul 13, 2026

Copy link
Copy Markdown
Member

Problem

The eager warmer's audience is a static enrollment list (~88 teams), but ~8,900 teams open the web analytics dashboard daily. To decide whether warming should extend beyond the curated list, we want to scale the warm audience empirically and watch cluster behavior at each step.

Changes

  • New active_teams_pct field (0-100) on the warm job's Dagster run config, default 0 = current behavior (static enrollment lists only). The hourly schedule passes no config, so scheduled runs are unchanged.
  • When set, the audience unions the static lists with that percentage of the most active WA dashboard teams (last 24h stats-table tile queries in query_log, warmers/API traffic excluded), most active first.
  • Static lists stay at the front of the ordering so always-enrolled teams warm before the ramp audience if a run is truncated by the job's max_runtime.
  • The activity fetch is best-effort: on any failure the audience falls back to the static lists rather than skipping the run.

Operating it: launch the job manually from the Dagster UI with e.g. ops: {warm_eager_baseline_op: {config: {active_teams_pct: 5}}}, watch aux insert counts / part+merge pressure / failure codes, then re-launch at 25, then 100. Stopping the experiment is just not launching again - the extra windows age out via TTL. Measured baseline for extrapolation: 88 teams ≈ 5.8k cold inserts / 8.5k insert-seconds, aux at ~13% CPU.

How did you test this code?

  • Audience-resolution tests updated: existing diag assertions extended, plus a parameterized case asserting the percentage slice of the fetched active list appends after (and dedupes against) the static lists at 50% and 100%.
  • Local DB was down (stack stopped), so the suite runs in CI; syntax and lint pass locally.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Authored with Claude Code. First iteration used a live instance setting; Lucas preferred a Dagster run-config parameter since he starts/stops the job from the UI anyway, so the knob moved onto the job itself with the default preserving the preselected list. Percentage semantics (rather than a raw team count) chosen per his framing - "a percentage of the active users on WA".

@lricoy lricoy self-assigned this Jul 13, 2026
@trunk-io

trunk-io Bot commented Jul 13, 2026

Copy link
Copy Markdown

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@lricoy lricoy changed the title feat(web-analytics): ramp eager warmer audience by recent dashboard activity feat(web-analytics): warm audience percentage via dagster run config Jul 13, 2026
@lricoy
lricoy marked this pull request as ready for review July 13, 2026 18:42
@pr-assigner-resolver-posthog
pr-assigner-resolver-posthog Bot requested a review from a team July 13, 2026 18:42
@greptile-apps

greptile-apps Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "Merge branch 'master' into lricoy/wa-eag..." | Re-trigger Greptile

Comment thread products/web_analytics/dags/eager_web_analytics_precompute.py Outdated

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

Copy link
Copy Markdown

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: 4b14760950

ℹ️ 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 thread products/web_analytics/dags/eager_web_analytics_precompute.py
Comment thread products/web_analytics/dags/eager_web_analytics_precompute.py
@lricoy lricoy added the stamphog Request AI approval (no full review) label Jul 13, 2026

@stamphog stamphog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Opt-in-only change to an internal Dagster warming job (default behavior unchanged, scheduled runs unaffected); author is on the owning team with STRONG familiarity, and the two substantive review threads (Greptile, Codex) around validation, precompute gating, and warm-order priority were fixed and confirmed resolved in the current diff, with a positive Greptile reaction.

  • Author wrote 100% of the modified lines and has 36 merged PRs in these paths (familiarity STRONG).
  • 👍 on the PR from greptile-apps[bot], hex-security-app[bot].
Gate mechanics and policy version
Gate Result
prerequisites all clear
deny-list no deny categories matched
size 93L, 1F substantive, 120L/2F incl. docs/generated/snapshots — within ceiling
tier T1-agent / T1c-medium (120L, 2F, single-area, feat)
stamphog 2.0.0b3 .stamphog/policy.yml @ 1e39350 · reviewed head 3c2a974

@lricoy
lricoy merged commit 7a03b89 into master Jul 13, 2026
245 of 248 checks passed
@lricoy
lricoy deleted the lricoy/wa-eager-warm-active-audience branch July 13, 2026 20:09
@deployment-status-posthog

deployment-status-posthog Bot commented Jul 13, 2026

Copy link
Copy Markdown

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-07-13 20:41 UTC Run
prod-us ✅ Deployed 2026-07-13 20:53 UTC Run
prod-eu ✅ Deployed 2026-07-13 20:56 UTC Run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stamphog Request AI approval (no full review)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant