feat(billing): Add UsageService to billing platform#110157
Merged
Conversation
Adds the UsageService interface to sentry's billing platform. The default implementation returns an empty response; GetSentry will override this with Postgres/ClickHouse backends.
491e81b to
e0c442b
Compare
volokluev
approved these changes
Mar 9, 2026
vbro
approved these changes
Mar 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the
UsageServiceinterface to the billing platform as part of BIL-2144.UsageService(BillingService)with aget_usage(GetUsageRequest) -> GetUsageResponsemethodsentry-protosv0.8.3+ protobuf types (GetUsageRequest,GetUsageResponse,DailyUsage,CategoryUsage, etc.)services/README.mdwith UsageService documentationPer
INTENTION.md, the Usage Service is the one exception that has implementation in the sentry repo (available in both self-hosted and SaaS).Requires https://github.com/getsentry/getsentry/pull/19515
Follow-up
UsageServicewith Postgres backend + feature flag/date-based routinghad_custom_dynamic_samplingto use the UsageServiceTest plan
pytest tests/sentry/billing/platform/services/usage/test_service.py)