From ce3d4c67f648804ec48d266e76b561539f05b68e Mon Sep 17 00:00:00 2001 From: volokluev <3169433+volokluev@users.noreply.github.com> Date: Mon, 22 Jun 2026 13:54:59 -0700 Subject: [PATCH 1/2] Add budget exhaustion field to UsagePricer The usage pricer already knows whether a PAYG budget has been exhausted. We don't charge customers over the budget that has been set. Expose this information so that we can leverage it in the quota enforcement --- .../services/usage_pricer/v1/endpoint_usage_pricer.proto | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/proto/sentry_protos/billing/v1/services/usage_pricer/v1/endpoint_usage_pricer.proto b/proto/sentry_protos/billing/v1/services/usage_pricer/v1/endpoint_usage_pricer.proto index dd4b1643..af3451f4 100644 --- a/proto/sentry_protos/billing/v1/services/usage_pricer/v1/endpoint_usage_pricer.proto +++ b/proto/sentry_protos/billing/v1/services/usage_pricer/v1/endpoint_usage_pricer.proto @@ -45,8 +45,11 @@ message LineItemUsageSummary { // Net cents consumed by this line item in the billing period (after credits/trials applied). uint64 payg_spend_cents = 2; - // How much of the line item was consumed (in the line item's units) + // How much of the line item was consumed by PAYG (in the line item's units) uint64 quantity = 3; + + // Whether the usage pricer had to cap the spend based on the budget set by the contract + bool payg_budget_exhausted = 4; } message SharedLineItemUsageSummary { @@ -55,6 +58,9 @@ message SharedLineItemUsageSummary { // Line item breakdown within shared budget repeated LineItemUsageSummary line_item_summaries = 2; + + // Whether the usage pricer had to cap the spend based on the budget set by the contract + bool payg_budget_exhausted = 3; } message UsagePricerResponse { From c9b8f00c3dbfed0a0196170607b7e1b658b8891f Mon Sep 17 00:00:00 2001 From: "getsantry[bot]" <66042841+getsantry[bot]@users.noreply.github.com> Date: Mon, 22 Jun 2026 20:58:24 +0000 Subject: [PATCH 2/2] chore: Regenerate Rust bindings --- Cargo.lock | 2 +- .../sentry_protos.billing.v1.services.usage_pricer.v1.rs | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 812b14d5..75841175 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -717,7 +717,7 @@ checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "sentry_protos" -version = "0.32.2" +version = "0.32.3" dependencies = [ "prost", "prost-types", diff --git a/rust/src/sentry_protos.billing.v1.services.usage_pricer.v1.rs b/rust/src/sentry_protos.billing.v1.services.usage_pricer.v1.rs index 7901199b..47c52361 100644 --- a/rust/src/sentry_protos.billing.v1.services.usage_pricer.v1.rs +++ b/rust/src/sentry_protos.billing.v1.services.usage_pricer.v1.rs @@ -45,9 +45,12 @@ pub struct LineItemUsageSummary { /// Net cents consumed by this line item in the billing period (after credits/trials applied). #[prost(uint64, tag = "2")] pub payg_spend_cents: u64, - /// How much of the line item was consumed (in the line item's units) + /// How much of the line item was consumed by PAYG (in the line item's units) #[prost(uint64, tag = "3")] pub quantity: u64, + /// Whether the usage pricer had to cap the spend based on the budget set by the contract + #[prost(bool, tag = "4")] + pub payg_budget_exhausted: bool, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct SharedLineItemUsageSummary { @@ -57,6 +60,9 @@ pub struct SharedLineItemUsageSummary { /// Line item breakdown within shared budget #[prost(message, repeated, tag = "2")] pub line_item_summaries: ::prost::alloc::vec::Vec, + /// Whether the usage pricer had to cap the spend based on the budget set by the contract + #[prost(bool, tag = "3")] + pub payg_budget_exhausted: bool, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct UsagePricerResponse {