Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions proto/sentry_protos/snuba/v1/endpoint_trace_item_table.proto
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ message Column {
AttributeConditionalAggregation conditional_aggregation = 5;
BinaryFormula formula = 4;
Literal literal = 6;
ConditionalFormula conditional_formula = 7;
}
string label = 3;

Expand All @@ -111,6 +112,27 @@ message Column {
int64 default_value_int64 = 5;
}
}

message FormulaCondition {
enum Op {
OP_UNSPECIFIED = 0;
OP_LESS_THAN = 1;
OP_GREATER_THAN = 2;
OP_LESS_THAN_OR_EQUALS = 3;
OP_GREATER_THAN_OR_EQUALS = 4;
OP_EQUALS = 5;
OP_NOT_EQUALS = 6;
}
Column left = 1;
Op op = 2;
Column right = 3;
}

message ConditionalFormula {
FormulaCondition condition = 1;
Column match = 2;
Column default = 3;
}
}

message TraceItemColumnValues {
Expand Down
78 changes: 77 additions & 1 deletion rust/src/sentry_protos.snuba.v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1893,7 +1893,7 @@ pub mod aggregation_filter {
pub struct Column {
#[prost(string, tag = "3")]
pub label: ::prost::alloc::string::String,
#[prost(oneof = "column::Column", tags = "1, 2, 5, 4, 6")]
#[prost(oneof = "column::Column", tags = "1, 2, 5, 4, 6, 7")]
pub column: ::core::option::Option<column::Column>,
}
/// Nested message and enum types in `Column`.
Expand Down Expand Up @@ -1968,6 +1968,80 @@ pub mod column {
DefaultValueInt64(i64),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FormulaCondition {
#[prost(message, optional, boxed, tag = "1")]
pub left: ::core::option::Option<::prost::alloc::boxed::Box<super::Column>>,
#[prost(enumeration = "formula_condition::Op", tag = "2")]
pub op: i32,
#[prost(message, optional, boxed, tag = "3")]
pub right: ::core::option::Option<::prost::alloc::boxed::Box<super::Column>>,
}
/// Nested message and enum types in `FormulaCondition`.
pub mod formula_condition {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Op {
Unspecified = 0,
LessThan = 1,
GreaterThan = 2,
LessThanOrEquals = 3,
GreaterThanOrEquals = 4,
Equals = 5,
NotEquals = 6,
}
impl Op {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "OP_UNSPECIFIED",
Self::LessThan => "OP_LESS_THAN",
Self::GreaterThan => "OP_GREATER_THAN",
Self::LessThanOrEquals => "OP_LESS_THAN_OR_EQUALS",
Self::GreaterThanOrEquals => "OP_GREATER_THAN_OR_EQUALS",
Self::Equals => "OP_EQUALS",
Self::NotEquals => "OP_NOT_EQUALS",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"OP_UNSPECIFIED" => Some(Self::Unspecified),
"OP_LESS_THAN" => Some(Self::LessThan),
"OP_GREATER_THAN" => Some(Self::GreaterThan),
"OP_LESS_THAN_OR_EQUALS" => Some(Self::LessThanOrEquals),
"OP_GREATER_THAN_OR_EQUALS" => Some(Self::GreaterThanOrEquals),
"OP_EQUALS" => Some(Self::Equals),
"OP_NOT_EQUALS" => Some(Self::NotEquals),
_ => None,
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConditionalFormula {
#[prost(message, optional, boxed, tag = "1")]
pub condition: ::core::option::Option<
::prost::alloc::boxed::Box<FormulaCondition>,
>,
#[prost(message, optional, boxed, tag = "2")]
pub r#match: ::core::option::Option<::prost::alloc::boxed::Box<super::Column>>,
#[prost(message, optional, boxed, tag = "3")]
pub default: ::core::option::Option<::prost::alloc::boxed::Box<super::Column>>,
}
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Column {
#[prost(message, tag = "1")]
Expand All @@ -1980,6 +2054,8 @@ pub mod column {
Formula(::prost::alloc::boxed::Box<BinaryFormula>),
#[prost(message, tag = "6")]
Literal(super::Literal),
#[prost(message, tag = "7")]
ConditionalFormula(::prost::alloc::boxed::Box<ConditionalFormula>),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
Expand Down
Loading