Skip to content

docs(usage_pricer): Clarify payg_budget_exhausted semantics#329

Open
armenzg wants to merge 4 commits into
mainfrom
armenzg/payg-budget-exhausted-doc
Open

docs(usage_pricer): Clarify payg_budget_exhausted semantics#329
armenzg wants to merge 4 commits into
mainfrom
armenzg/payg-budget-exhausted-doc

Conversation

@armenzg

@armenzg armenzg commented Jun 25, 2026

Copy link
Copy Markdown
Member

Rewrites the payg_budget_exhausted doc comments on LineItemUsageSummary (field 4) and SharedLineItemUsageSummary (field 3) so consumers can reason about the flag without reading the getsentry producer. Comment-only; no wire-format change.

The old comment ("the usage pricer had to cap the spend") was misleading: the producer sets the flag whenever there is no budget left, even when no spend was actually reduced (pre-cap spend exactly equal to the cap). The field now documents the producer's real semantics:

  • No budget remaining means pre-cap spend reaches the cap (>=), or there is any spend when the cap is 0.
  • For a shared (all-items) budget the comparison uses the pooled pre-cap spend, so a line item can be flagged exhausted even when its own spend is small.
  • Always false for items priced at an uncapped rate (e.g. Seer) and for items with no configured cap, since neither counts against a PAYG budget.

The shared-summary comment now points at the line-item doc instead of restating the rule, so the two cannot drift.

The regenerated Rust binding carries the same doc text; review the .proto change and treat the .rs change as generated output.

@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown

The latest Buf updates on your PR. Results from workflow ci / buf-checks (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedJun 26, 2026, 6:42 PM

@armenzg armenzg self-assigned this Jun 26, 2026
@armenzg armenzg marked this pull request as ready for review June 26, 2026 17:59
@armenzg armenzg requested a review from a team as a code owner June 26, 2026 17:59
armenzg and others added 3 commits June 26, 2026 14:16
Document that payg_budget_exhausted means no budget remaining (pre-cap spend >=
cap, or any spend when the cap is 0) rather than "had to cap", matching the
producer in getsentry.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Clarify that "no budget remaining" uses pooled pre-cap spend for shared
(all-items) budgets, and that the flag is always false for uncapped-rate
items (e.g. Seer) and items with no configured cap.

Co-authored-by: Cursor <cursoragent@cursor.com>
@armenzg armenzg force-pushed the armenzg/payg-budget-exhausted-doc branch 2 times, most recently from 9624a06 to a188b6e Compare June 26, 2026 18:41
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