Skip to content

The platform for continuously improving AI agents.

6.0 KB
Raw Blame
syntax = "proto3";
package api.v1;

import "google/protobuf/struct.proto";
import "google/protobuf/timestamp.proto";

service SignalService {
  rpc ListSignalEvents(ListSignalEventsRequest) returns (ListSignalEventsResponse);
  rpc GetSignalInsights(GetSignalInsightsRequest) returns (GetSignalInsightsResponse);
  rpc ListSignalCatalog(ListSignalCatalogRequest) returns (ListSignalCatalogResponse);
  rpc SetSignalSubscription(SetSignalSubscriptionRequest) returns (SetSignalSubscriptionResponse);
  rpc MarkSignalsSeen(MarkSignalsSeenRequest) returns (MarkSignalsSeenResponse);
  rpc RunSignals(RunSignalsRequest) returns (RunSignalsResponse);
  rpc CreateCustomSignal(CreateCustomSignalRequest) returns (CreateCustomSignalResponse);
  rpc UpdateCustomSignal(UpdateCustomSignalRequest) returns (UpdateCustomSignalResponse);
  rpc DeleteCustomSignal(DeleteCustomSignalRequest) returns (DeleteCustomSignalResponse);
  rpc TestCustomSignal(TestCustomSignalRequest) returns (TestCustomSignalResponse);
}

message SignalEvidence {
  string span_id = 1;
  string trace_id = 2;
  string name = 3;
  optional string span_type = 4;
  string status = 5;
  optional string status_message = 6;
  optional string model = 7;
  optional string tool = 8;
  double duration_ms = 9;
  optional int64 tokens = 10;
  optional double cost = 11;
  optional string input = 12;
  optional string output = 13;
  optional string reason = 14;
}

message RecommendedAction {
  string kind = 1;
  string label = 2;
}

message SignalDetails {
  int32 spans = 1;
  string group = 2;
  repeated string trace_ids = 3;
  repeated string group_trace_ids = 4;
  repeated string span_ids = 5;
  string why = 6;
  google.protobuf.Struct parameters = 7;
  google.protobuf.Struct measurements = 8;
  repeated SignalEvidence evidence = 9;
  bool evidence_truncated = 10;
  repeated RecommendedAction recommended_actions = 11;
}

message SignalEvent {
  string id = 1;
  string signal_type = 2;
  string severity = 3;
  string service_name = 4;
  string message = 5;
  SignalDetails details = 6;
  string trace_id = 7;
  optional string conversation_id = 8;
  string dedupe_key = 9;
  int64 occurred_at_ms = 10;
  optional int64 seen_at_ms = 11;
  google.protobuf.Timestamp occurred_at = 12;
  google.protobuf.Timestamp seen_at = 13;
}

message ListSignalEventsRequest {
  int32 page_size = 1;
  string page_token = 2;
  string service_name = 3;
  string signal_type = 4;
  string severity = 5;
  bool unseen_only = 6;
  string trace_id = 7;
  optional int64 since_ms = 8;
}

message ListSignalEventsResponse {
  repeated SignalEvent events = 1;
  string next_page_token = 2;
  int64 total_count = 3;
  int64 unseen_count = 4;
}

message DailyCount {
  string date = 1;
  int64 count = 2;
}

message SignalInsight {
  string signal_type = 1;
  string title = 2;
  string severity = 3;
  string status = 4;
  int64 total_count = 5;
  int64 unseen_count = 6;
  int64 recent_count = 7;
  int64 previous_count = 8;
  int64 affected_traces = 9;
  string remedy = 10;
  repeated string top_causes = 11;
  repeated DailyCount daily_counts = 12;
  string category = 13;
  bool is_custom = 14;
}

message GetSignalInsightsRequest {
  int32 days = 1;
  string service_name = 2;
}

message GetSignalInsightsResponse {
  repeated SignalInsight insights = 1;
  int64 total_events = 2;
  int64 total_unseen = 3;
  repeated DailyCount daily_counts = 4;
}

message CustomSignalFilters {
  string service_name = 1;
  string span_type = 2;
  string span_name_contains = 3;
  string model_contains = 4;
}

message CustomCondition {
  string field = 1;
  string op = 2;
  string value = 3;
}

message CustomSignalSpec {
  string scope = 1;
  CustomSignalFilters filters = 2;
  string match_mode = 3;
  repeated CustomCondition conditions = 4;
}

message SignalCatalogItem {
  string signal_type = 1;
  string title = 2;
  string description = 3;
  string category = 4;
  string severity = 5;
  bool default_enabled = 6;
  google.protobuf.Struct default_params = 7;
  string remedy = 8;
  bool enabled = 9;
  google.protobuf.Struct effective_config = 10;
  bool is_custom = 11;
  optional CustomSignalSpec spec = 12;
}

message SignalSubscription {
  string service_name = 1;
  string signal_type = 2;
  bool enabled = 3;
  google.protobuf.Struct config = 4;
  int64 updated_at_ms = 5;
}

message ListSignalCatalogRequest {
  string service_name = 1;
}

message ListSignalCatalogResponse {
  repeated SignalCatalogItem items = 1;
  repeated SignalSubscription subscriptions = 2;
}

message SetSignalSubscriptionRequest {
  string service_name = 1;
  string signal_type = 2;
  bool enabled = 3;
  google.protobuf.Struct config = 4;
}

message SetSignalSubscriptionResponse {
  SignalSubscription subscription = 1;
}

message MarkSignalsSeenRequest {
  repeated string ids = 1;
  bool mark_all = 2;
  string service_name = 3;
  string signal_type = 4;
}

message MarkSignalsSeenResponse {
  int64 updated_count = 1;
}

message RunSignalsRequest {}

message RunSignalsResponse {
  int64 created_count = 1;
}

message CreateCustomSignalRequest {
  string signal_type = 1;
  string title = 2;
  string description = 3;
  string severity = 4;
  string remedy = 5;
  optional bool enabled = 6;
  CustomSignalSpec spec = 7;
}

message CreateCustomSignalResponse {
  SignalCatalogItem item = 1;
}

message UpdateCustomSignalRequest {
  string signal_type = 1;
  string title = 2;
  string description = 3;
  string severity = 4;
  string remedy = 5;
  optional bool enabled = 6;
  CustomSignalSpec spec = 7;
}

message UpdateCustomSignalResponse {
  SignalCatalogItem item = 1;
}

message DeleteCustomSignalRequest {
  string signal_type = 1;
}

message DeleteCustomSignalResponse {
  bool deleted = 1;
}

message TestCustomSignalRequest {
  string title = 1;
  string severity = 2;
  CustomSignalSpec spec = 3;
  int32 window_days = 4;
}

message CustomSignalSampleMatch {
  string trace_id = 1;
  string service_name = 2;
  string summary = 3;
  string why = 4;
  int32 evidence_count = 5;
  int64 occurred_at_ns = 6;
}

message TestCustomSignalResponse {
  int32 matched_groups = 1;
  int32 scanned_groups = 2;
  repeated CustomSignalSampleMatch samples = 3;
}