Skip to content

feat(billing): Add category filtering to GetUsageRequest#183

Merged
dashed merged 2 commits intomainfrom
billing/BIL-2176
Mar 10, 2026
Merged

feat(billing): Add category filtering to GetUsageRequest#183
dashed merged 2 commits intomainfrom
billing/BIL-2176

Conversation

@dashed
Copy link
Member

@dashed dashed commented Mar 9, 2026

Closes https://linear.app/getsentry/issue/BIL-2176/add-category-filtering-to-getusagerequest-proto

Summary

  • Adds repeated DataCategory categories = 4 field to GetUsageRequest proto message
  • Allows callers to filter usage results to specific data categories instead of fetching all
  • Empty list means "all categories" (backwards compatible, no-op for existing callers)

Motivation

When checking for specific usage patterns (e.g., had_custom_dynamic_sampling which only cares about SPAN_INDEXED), fetching all categories is wasteful. This field enables server-side filtering.

Test plan

  • Proto compiles with make build-py
  • Generated Python stubs include categories field with correct type
  • CI passes

BIL-2176

Add a repeated DataCategory categories field to GetUsageRequest,
allowing callers to filter usage results to specific data categories.
When empty, all categories are returned (backwards compatible).

BIL-2176
@linear-code
Copy link

linear-code bot commented Mar 9, 2026

@github-actions
Copy link

github-actions bot commented Mar 9, 2026

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed⏩ skipped✅ passed✅ passedMar 9, 2026, 10:12 PM

@dashed dashed requested review from a team and noahsmartin March 9, 2026 22:25
Copy link

@vbro vbro left a comment

Choose a reason for hiding this comment

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

LGTM
Should it also be possible to filter by SKU?

@dashed
Copy link
Member Author

dashed commented Mar 10, 2026

LGTM Should it also be possible to filter by SKU?

I think so. I'll add it when the need arises.

@dashed dashed merged commit 8c6355e into main Mar 10, 2026
11 checks passed
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.

5 participants