diff --git a/Cargo.lock b/Cargo.lock index 09d2f89c..0af9158c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -717,7 +717,7 @@ checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "sentry_protos" -version = "0.90.0" +version = "0.91.0" dependencies = [ "prost", "prost-types", 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 56de506c..c7c388cc 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 @@ -67,14 +67,14 @@ message LineItemUsageSummary { 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; + bool payg_budget_exhausted = 4 [deprecated = true]; // false when this line item still has reserved quantity left. // It's possible that PAYG is exhausted whereas reserved is not. // Example: there's an overall PAYG budget of $10, a customer sends $10 worth of errors // the payg_budget_exhausted field is true for all line items // however, the plan still includes 5GB of free logs, so reserved_budget_exhausted is false for logs. - bool reserved_budget_exhausted = 5; + bool reserved_budget_exhausted = 5 [deprecated = true]; // Total units consumed by this line item in the billing period, including // both reserved and PAYG usage (in the line item's units). Unlike `quantity`, @@ -94,6 +94,11 @@ message LineItemUsageSummary { // grants are applied, but before reserved quantity is deducted. This includes // both reserved and PAYG usage (in the line item's units). uint64 non_granted_quantity = 9; + + // True when PAYG spend is greater than the budget. + // For example, a $1 allocation against a $1 budget returns false. + // For an all-items budget, compares the total spend across its line items. + bool exceeded_payg_budget = 10; } message SharedLineItemUsageSummary { @@ -104,13 +109,16 @@ message SharedLineItemUsageSummary { 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; + bool payg_budget_exhausted = 3 [deprecated = true]; // false when this pool still has reserved quantity left. - bool reserved_budget_exhausted = 4; + bool reserved_budget_exhausted = 4 [deprecated = true]; // True when any member of this pool can continue accepting usage. bool has_remaining_capacity = 5; + + // True when any member's PAYG spend is greater than its budget. + bool exceeded_payg_budget = 6; } // One project's per-day outcomes. Only days and line items with usage 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 295f6307..1ce586f2 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 @@ -123,6 +123,7 @@ pub struct LineItemUsageSummary { #[prost(uint64, tag = "3")] pub quantity: u64, /// Whether the usage pricer had to cap the spend based on the budget set by the contract + #[deprecated] #[prost(bool, tag = "4")] pub payg_budget_exhausted: bool, /// false when this line item still has reserved quantity left. @@ -130,6 +131,7 @@ pub struct LineItemUsageSummary { /// Example: there's an overall PAYG budget of $10, a customer sends $10 worth of errors /// the payg_budget_exhausted field is true for all line items /// however, the plan still includes 5GB of free logs, so reserved_budget_exhausted is false for logs. + #[deprecated] #[prost(bool, tag = "5")] pub reserved_budget_exhausted: bool, /// Total units consumed by this line item in the billing period, including @@ -151,6 +153,11 @@ pub struct LineItemUsageSummary { /// both reserved and PAYG usage (in the line item's units). #[prost(uint64, tag = "9")] pub non_granted_quantity: u64, + /// True when PAYG spend is greater than the budget. + /// For example, a $1 allocation against a $1 budget returns false. + /// For an all-items budget, compares the total spend across its line items. + #[prost(bool, tag = "10")] + pub exceeded_payg_budget: bool, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct SharedLineItemUsageSummary { @@ -161,14 +168,19 @@ pub struct SharedLineItemUsageSummary { #[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 + #[deprecated] #[prost(bool, tag = "3")] pub payg_budget_exhausted: bool, /// false when this pool still has reserved quantity left. + #[deprecated] #[prost(bool, tag = "4")] pub reserved_budget_exhausted: bool, /// True when any member of this pool can continue accepting usage. #[prost(bool, tag = "5")] pub has_remaining_capacity: bool, + /// True when any member's PAYG spend is greater than its budget. + #[prost(bool, tag = "6")] + pub exceeded_payg_budget: bool, } /// One project's per-day outcomes. Only days and line items with usage /// are present; anything missing had no usage.