Skip to content

Commit

Permalink
Merge pull request #9 from getsentry/snuba_protos
Browse files Browse the repository at this point in the history
Add snuba protobuf files for EAP
  • Loading branch information
colin-sentry authored Aug 15, 2024
2 parents 4800abb + b4fed56 commit 5f090b0
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 0 deletions.
34 changes: 34 additions & 0 deletions proto/sentry_protos/snuba/v1alpha/endpoint_aggregate_bucket.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
syntax = "proto3";

package sentry_protos.snuba.v1alpha;

import "google/protobuf/timestamp.proto";
import "sentry_protos/snuba/v1alpha/request_common.proto";
import "sentry_protos/snuba/v1alpha/trace_item_filter.proto";

message AggregateBucketRequest {
RequestMeta meta = 1;
enum Function {
FUNCTION_UNSPECIFIED = 0;
FUNCTION_SUM = 1;
FUNCTION_AVERAGE = 2;
FUNCTION_COUNT = 3;
FUNCTION_P50 = 4;
FUNCTION_P95 = 5;
FUNCTION_P99 = 6;
FUNCTION_AVG = 7;
}

google.protobuf.Timestamp start_timestamp = 2;
google.protobuf.Timestamp end_timestamp = 3;
Function aggregate = 4;
TraceItemFilter filter = 5;
uint64 granularity_secs = 6;
string metric_name = 7;

//TODO: group by, topn, etc, not necessary for MVP
}

message AggregateBucketResponse {
repeated float result = 1;
}
15 changes: 15 additions & 0 deletions proto/sentry_protos/snuba/v1alpha/endpoint_find_trace.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
syntax = "proto3";

package sentry_protos.snuba.v1alpha;

import "sentry_protos/snuba/v1alpha/request_common.proto";
import "sentry_protos/snuba/v1alpha/trace_item_filter.proto";

message FindTraceRequest {
RequestMeta meta = 1;
repeated TraceItemFilter filters = 2;
}

message FindTraceResponse {
repeated string trace_uuids = 1;
}
10 changes: 10 additions & 0 deletions proto/sentry_protos/snuba/v1alpha/request_common.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
syntax = "proto3";

package sentry_protos.snuba.v1alpha;

message RequestMeta {
uint64 organization_id = 1;
string cogs_category = 2;
string referrer = 3;
repeated uint64 project_ids = 4; // can be empty
}
55 changes: 55 additions & 0 deletions proto/sentry_protos/snuba/v1alpha/trace_item_filter.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
syntax = "proto3";

package sentry_protos.snuba.v1alpha;

message AndFilter {
repeated TraceItemFilter filters = 1;
}

message OrFilter {
repeated TraceItemFilter filters = 1;
}

message NumericalFilter {
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;
}
string key = 1;
Op op = 2;
float value = 3;
}

message StringFilter {
enum Op {
OP_UNSPECIFIED = 0;
OP_EQUALS = 1;
OP_NOT_EQUALS = 2;
OP_LIKE = 3;
OP_NOT_LIKE = 4;
}
string key = 1;
Op op = 2;
string value = 3;
}

message ExistsFilter {
string key = 1;
}

// Represents a condition on searching for a particular "trace item"
// (e.g., spans, replays, errors)
message TraceItemFilter {
oneof value {
AndFilter and_filter = 1;
OrFilter or_filter = 2;
NumericalFilter number_filter = 3;
StringFilter string_filter = 4;
ExistsFilter exists_filter = 5;
}
}

0 comments on commit 5f090b0

Please sign in to comment.