Skip to content

feat(billing): Add SGM service protos for enforcement and pricing#182

Open
volokluev wants to merge 5 commits intomainfrom
volo/billing/sgm
Open

feat(billing): Add SGM service protos for enforcement and pricing#182
volokluev wants to merge 5 commits intomainfrom
volo/billing/sgm

Conversation

@volokluev
Copy link
Member

@volokluev volokluev commented Mar 6, 2026

Human Stuff

Proto definitions written by hand, claude resolved linter errors and created PR

Robot stuff

Add protocol buffer definitions for the Spend Growth Management (SGM) billing service.

What's included

EnforcementDecision: Defines enforcement actions that can be applied when contracts approach or exceed usage limits. Supports two enforcement types:

  • Rate limiting: Throttle incoming data
  • Sampling: Reduce data ingestion through sampling

Enforcement decisions are tracked per data category (since Relay ingests by data category) and include contract/org context, explanation, and time bounds.

PricedUsage: Tracks the current monetary spend per SKU within a contract. This provides the usage state needed to make enforcement decisions.

Why these changes

These protos enable runtime enforcement of billing limits by providing:

  1. A way to communicate enforcement decisions from the billing service to Relay
  2. Current usage tracking to inform when enforcement should trigger

The SGM service will use these messages to evaluate contract usage against limits and determine appropriate enforcement actions.

🤖 Generated with Claude Code

Add proto definitions for the Spend Governance Module (SGM) billing service:

- EnforcementDecision: Defines enforcement actions (rate limiting or sampling)
  based on contract usage, tracked per data category
- PricedUsage: Tracks current usage spend per SKU within a contract

These protos support runtime enforcement decisions and usage tracking for
billing contracts.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@github-actions
Copy link

github-actions bot commented Mar 6, 2026

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed⏩ skipped✅ passed✅ passedMar 6, 2026, 8:07 PM

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