Skip to content

feat(billing): Add endpoint for fetching orgs with usage#194

Merged
brendanhsentry merged 11 commits intomainfrom
brendan/get-orgs-with-usage
Apr 3, 2026
Merged

feat(billing): Add endpoint for fetching orgs with usage#194
brendanhsentry merged 11 commits intomainfrom
brendan/get-orgs-with-usage

Conversation

@brendanhsentry
Copy link
Copy Markdown
Member

Will be used to fetch orgs that have sent usage between start and end time stamps.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 2, 2026

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed⏩ skipped✅ passed✅ passedApr 3, 2026, 7:22 PM

@brendanhsentry brendanhsentry marked this pull request as ready for review April 2, 2026 20:35
@brendanhsentry brendanhsentry requested a review from a team April 2, 2026 20:35
repeated DataCategory categories = 3;
}

message GetOrgsWithUsageResponse {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this is going to return ALL active orgs, you probably don't want that

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

should we add limit: int field or something to the request?

Copy link
Copy Markdown
Member

@volokluev volokluev Apr 2, 2026

Choose a reason for hiding this comment

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

I would add a limit and pagetoken to the request and a pagetoken to the response (which can just be an offset for now)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ok i was following what i saw in other snuba endpoints and added the pagetoken to the request as well

import "sentry_protos/billing/v1/data_category.proto";

message PageToken {
uint64 offset = 1;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

should be a oneof here such that it can be different things but not many things

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

whoops i misunderstood earlier

@brendanhsentry brendanhsentry merged commit e4d9aa1 into main Apr 3, 2026
12 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.

2 participants