From df4b258c20d97ed25a4cc2440d33b8bf7ca1db5a Mon Sep 17 00:00:00 2001 From: Saraj Manes Date: Fri, 8 May 2026 11:48:37 -0400 Subject: [PATCH 1/4] feat(explore): Add optional index field to AttributeKey for array element access Adds `optional sint32 index` on `AttributeKey` to support indexed access into array-typed attributes (e.g. `field[N]:value` syntax). Signed to leave room for negative indexing; --- proto/sentry_protos/snuba/v1/trace_item_attribute.proto | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/proto/sentry_protos/snuba/v1/trace_item_attribute.proto b/proto/sentry_protos/snuba/v1/trace_item_attribute.proto index 17398316..0c9ad64d 100644 --- a/proto/sentry_protos/snuba/v1/trace_item_attribute.proto +++ b/proto/sentry_protos/snuba/v1/trace_item_attribute.proto @@ -20,6 +20,10 @@ message AttributeKey { // `sentry.` to allow users to send attributes of the same name. // Exampe: `sentry.duration`, `sentry.span_id` etc string name = 2; + + // Optional indexed access into an array-typed attribute (only meaningful when type == TYPE_ARRAY). + // Signed to allow negative indexing (e.g. -1 for the last element). + optional sint32 index = 3; } // this allow us to select single key such as span.attr1 From 9c27a3c9523b10d4895b919df5e34ab04928188a Mon Sep 17 00:00:00 2001 From: "getsantry[bot]" <66042841+getsantry[bot]@users.noreply.github.com> Date: Fri, 8 May 2026 16:20:37 +0000 Subject: [PATCH 2/4] chore: Regenerate Rust bindings --- Cargo.lock | 2 +- rust/src/sentry_protos.snuba.v1.rs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index ba5c3c8e..ad90a3fa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -717,7 +717,7 @@ checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "sentry_protos" -version = "0.8.29" +version = "0.8.30" dependencies = [ "prost", "prost-types", diff --git a/rust/src/sentry_protos.snuba.v1.rs b/rust/src/sentry_protos.snuba.v1.rs index 1f93c29f..e2fe4172 100644 --- a/rust/src/sentry_protos.snuba.v1.rs +++ b/rust/src/sentry_protos.snuba.v1.rs @@ -8,6 +8,10 @@ pub struct AttributeKey { /// Exampe: `sentry.duration`, `sentry.span_id` etc #[prost(string, tag = "2")] pub name: ::prost::alloc::string::String, + /// Optional indexed access into an array-typed attribute (only meaningful when type == TYPE_ARRAY). + /// Signed to allow negative indexing (e.g. -1 for the last element). + #[prost(sint32, optional, tag = "3")] + pub index: ::core::option::Option, } /// Nested message and enum types in `AttributeKey`. pub mod attribute_key { From fbd49c1395ca51e63d76da7ae7ca9c482f2454e8 Mon Sep 17 00:00:00 2001 From: Saraj Manes Date: Fri, 8 May 2026 13:29:33 -0400 Subject: [PATCH 3/4] Remove the negative indexing possibility --- proto/sentry_protos/snuba/v1/trace_item_attribute.proto | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/proto/sentry_protos/snuba/v1/trace_item_attribute.proto b/proto/sentry_protos/snuba/v1/trace_item_attribute.proto index 0c9ad64d..e47e526f 100644 --- a/proto/sentry_protos/snuba/v1/trace_item_attribute.proto +++ b/proto/sentry_protos/snuba/v1/trace_item_attribute.proto @@ -22,8 +22,7 @@ message AttributeKey { string name = 2; // Optional indexed access into an array-typed attribute (only meaningful when type == TYPE_ARRAY). - // Signed to allow negative indexing (e.g. -1 for the last element). - optional sint32 index = 3; + optional uint32 index = 3; } // this allow us to select single key such as span.attr1 From e1a8c332bd6a8fa397b6f6c23b8b17bbd707bdc2 Mon Sep 17 00:00:00 2001 From: "getsantry[bot]" <66042841+getsantry[bot]@users.noreply.github.com> Date: Fri, 8 May 2026 17:30:39 +0000 Subject: [PATCH 4/4] chore: Regenerate Rust bindings --- rust/src/sentry_protos.snuba.v1.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rust/src/sentry_protos.snuba.v1.rs b/rust/src/sentry_protos.snuba.v1.rs index e2fe4172..13842d2b 100644 --- a/rust/src/sentry_protos.snuba.v1.rs +++ b/rust/src/sentry_protos.snuba.v1.rs @@ -9,9 +9,8 @@ pub struct AttributeKey { #[prost(string, tag = "2")] pub name: ::prost::alloc::string::String, /// Optional indexed access into an array-typed attribute (only meaningful when type == TYPE_ARRAY). - /// Signed to allow negative indexing (e.g. -1 for the last element). - #[prost(sint32, optional, tag = "3")] - pub index: ::core::option::Option, + #[prost(uint32, optional, tag = "3")] + pub index: ::core::option::Option, } /// Nested message and enum types in `AttributeKey`. pub mod attribute_key {