From 29dbd824013e85bd3ae24693d8cebfb206583516 Mon Sep 17 00:00:00 2001 From: Alberto Leal Date: Fri, 5 Jun 2026 17:57:52 -0400 Subject: [PATCH 1/2] feat(billing): add invoice_item_types to LineItemDetails A SKU's reserved, on-demand, and activated usage can each settle as a distinct InvoiceItemType. Collocating those identifiers on the SKU's LineItemDetails lets getsentry declare them per SKU instead of growing a shared enum. The new InvoiceItemTypes message keeps each context optional because some SKUs (e.g. Seer) fold their usage irregularly and do not populate every context. --- .../v1/common/v1/line_item_details.proto | 19 ++++++++++++++++++ .../src/sentry_protos.billing.v1.common.v1.rs | 20 +++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/proto/sentry_protos/billing/v1/common/v1/line_item_details.proto b/proto/sentry_protos/billing/v1/common/v1/line_item_details.proto index e97b0edf..1bfb7e6a 100644 --- a/proto/sentry_protos/billing/v1/common/v1/line_item_details.proto +++ b/proto/sentry_protos/billing/v1/common/v1/line_item_details.proto @@ -10,6 +10,9 @@ message LineItemDetails { // Unique identifier for the line item. string uid = 1; + // InvoiceItemType identifiers for this SKU, keyed by billing context. + InvoiceItemTypes invoice_item_types = 2; + // Customer-facing display name for the line item. string customer_facing_name = 3; @@ -22,3 +25,19 @@ message LineItemDetails { // Defines how usage data is transformed into this line item. BillableMetric billable_metric = 6; } + +// InvoiceItemType identifiers for a single SKU, split by billing context. +// Reserved, on-demand, and activated usage of the same SKU can each settle as a +// distinct InvoiceItemType, so every context carries its own identifier instead +// of collapsing into one. Contexts are optional because some SKUs (e.g. Seer) +// fold their usage irregularly and do not populate every context. +message InvoiceItemTypes { + // Type for reserved (prepaid) usage of this SKU. + optional string reserved = 1; + + // Type for on-demand (pay-as-you-go) usage of this SKU. + optional string ondemand = 2; + + // Type for activated usage of this SKU. + optional string activated = 3; +} diff --git a/rust/src/sentry_protos.billing.v1.common.v1.rs b/rust/src/sentry_protos.billing.v1.common.v1.rs index 0589afd1..f322ce69 100644 --- a/rust/src/sentry_protos.billing.v1.common.v1.rs +++ b/rust/src/sentry_protos.billing.v1.common.v1.rs @@ -224,6 +224,9 @@ pub struct LineItemDetails { /// Unique identifier for the line item. #[prost(string, tag = "1")] pub uid: ::prost::alloc::string::String, + /// InvoiceItemType identifiers for this SKU, keyed by billing context. + #[prost(message, optional, tag = "2")] + pub invoice_item_types: ::core::option::Option, /// Customer-facing display name for the line item. #[prost(string, tag = "3")] pub customer_facing_name: ::prost::alloc::string::String, @@ -237,6 +240,23 @@ pub struct LineItemDetails { #[prost(message, optional, tag = "6")] pub billable_metric: ::core::option::Option, } +/// InvoiceItemType identifiers for a single SKU, split by billing context. +/// Reserved, on-demand, and activated usage of the same SKU can each settle as a +/// distinct InvoiceItemType, so every context carries its own identifier instead +/// of collapsing into one. Contexts are optional because some SKUs (e.g. Seer) +/// fold their usage irregularly and do not populate every context. +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct InvoiceItemTypes { + /// Type for reserved (prepaid) usage of this SKU. + #[prost(string, optional, tag = "1")] + pub reserved: ::core::option::Option<::prost::alloc::string::String>, + /// Type for on-demand (pay-as-you-go) usage of this SKU. + #[prost(string, optional, tag = "2")] + pub ondemand: ::core::option::Option<::prost::alloc::string::String>, + /// Type for activated usage of this SKU. + #[prost(string, optional, tag = "3")] + pub activated: ::core::option::Option<::prost::alloc::string::String>, +} /// Stripe-specific payment information for an organization. #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct StripePaymentData { From 872267d9ca7dab423e0a631cc4a149fa1f7bfa31 Mon Sep 17 00:00:00 2001 From: "getsantry[bot]" <66042841+getsantry[bot]@users.noreply.github.com> Date: Fri, 5 Jun 2026 21:59:04 +0000 Subject: [PATCH 2/2] chore: Regenerate Rust bindings --- Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 384958e3..17cd60f3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -717,7 +717,7 @@ checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "sentry_protos" -version = "0.23.0" +version = "0.24.0" dependencies = [ "prost", "prost-types",