edition = "2023"; package workflows.v1; import "buf/validate/validate.proto"; import "opentelemetry/proto/logs/v1/logs.proto"; import "opentelemetry/proto/trace/v1/trace.proto"; import "tilebox/v1/id.proto"; import "tilebox/v1/query.proto"; // LogSeverityGroup is an enum that groups log severity levels into broader categories for easier filtering and analysis. enum LogSeverityGroup { LOG_SEVERITY_GROUP_UNSPECIFIED = 0; LOG_SEVERITY_GROUP_TRACE = 1; LOG_SEVERITY_GROUP_DEBUG = 2; LOG_SEVERITY_GROUP_INFO = 3; LOG_SEVERITY_GROUP_WARNING = 4; // Includes OpenTelemetry ERROR and FATAL severities. LOG_SEVERITY_GROUP_ERROR = 5; } // LogQueryFilters define additional query filters for log records, supported by both the QueryJobLogs and QueryLogsInInterval endpoints. // These filters can be used to narrow down the log entries returned by the query. message LogQueryFilters { // Filter log entries by severity levels. If not specified, all severity levels will be returned. repeated LogSeverityGroup severity_levels = 1 [(buf.validate.field).repeated.unique = true]; } // QueryJobLogsRequest is the request message for querying logs of a specific job, in ascending or descending order, // with pagination support. message QueryJobLogsRequest { // The ID of the job to query logs for. tilebox.v1.ID job_id = 1 [(buf.validate.field).required = true]; // The pagination parameters for this request. tilebox.v1.Pagination page = 2 [features.field_presence = EXPLICIT]; // The direction in which to sort log entries. If not specified, defaults to ascending order (oldest entries first). tilebox.v1.SortDirection sort_direction = 3; // The ID of the task to query logs for. If not specified, logs for the full job are returned. tilebox.v1.ID task_id = 4 [features.field_presence = EXPLICIT]; // Additional filters to apply to the log query. LogQueryFilters filters = 5; } // QueryLogsInIntervalRequest is the request message for querying logs in a specific time interval. // It can be used to query all log messages across multiple jobs, and can be filtered by other parameters in the future. message QueryLogsInIntervalRequest { // The time interval to query logs for. tilebox.v1.TimeInterval time_interval = 1; // The pagination parameters for this request. tilebox.v1.Pagination page = 2 [features.field_presence = EXPLICIT]; // The direction in which to sort log entries. If not specified, defaults to descending order (newest entries first). tilebox.v1.SortDirection sort_direction = 3; // Additional filters to apply to the log query. LogQueryFilters filters = 4; } // PaginatedLogsData is the response message for paginated log queries. It's a message compatible with LogsData, // but with an additional field for pagination parameters for the next page. message PaginatedLogsData { // An array of ResourceLogs. repeated .opentelemetry.proto.logs.v1.ResourceLogs resource_logs = 1; // The pagination parameters for the next page. tilebox.v1.Pagination next_page = 2 [features.field_presence = EXPLICIT]; } // GetLogMessageCountsRequest is the request message for retrieving counts of log messages per severity level within a specified time interval. message GetLogMessageCountsRequest { // The time interval to fetch log message counts for. tilebox.v1.TimeInterval time_interval = 1; } // GetJobLogMessageCountsRequest is the request message for retrieving counts of log messages per severity level for a job. message GetJobLogMessageCountsRequest { // The ID of the job to count logs for. tilebox.v1.ID job_id = 1 [(buf.validate.field).required = true]; // The ID of the task to count logs for. If not specified, logs for the full job are counted. tilebox.v1.ID task_id = 2 [features.field_presence = EXPLICIT]; } // GetLogMessageCountsResponse contains log message counts per severity level and a total across all severities. message GetLogMessageCountsResponse { repeated LogSeverityCount counts = 1; int64 total_messages = 2; } // LogSeverityCount is a message that represents the count of log messages for a specific severity level. message LogSeverityCount { LogSeverityGroup severity = 1; int64 count = 2; } // QueryJobLogsRequest is the request message for querying logs of a specific job, in ascending or descending order, // with pagination support. message QueryJobSpansRequest { // The ID of the job to query logs for. tilebox.v1.ID job_id = 1 [(buf.validate.field).required = true]; // The pagination parameters for this request. tilebox.v1.Pagination page = 2 [features.field_presence = EXPLICIT]; // The direction in which to sort log entries. If not specified, defaults to ascending order (oldest entries first). tilebox.v1.SortDirection sort_direction = 3; // The ID of the task to query spans for. If not specified, spans for the full job are returned. tilebox.v1.ID task_id = 4 [features.field_presence = EXPLICIT]; } // PaginatedSpansData is the response message for paginated log queries. It's a message compatible with LogsData, // but with an additional field for pagination parameters for the next page. message PaginatedSpansData { // An array of ResourceLogs. repeated .opentelemetry.proto.trace.v1.ResourceSpans resource_spans = 1; // The pagination parameters for the next page. tilebox.v1.Pagination next_page = 2 [features.field_presence = EXPLICIT]; } // TelemetryQueryService is the service definition for querying telemetry data about workflows such as logs, traces // and metrics. service TelemetryQueryService { rpc QueryJobLogs(QueryJobLogsRequest) returns (PaginatedLogsData); rpc QueryLogsInInterval(QueryLogsInIntervalRequest) returns (PaginatedLogsData); rpc GetLogMessageCounts(GetLogMessageCountsRequest) returns (GetLogMessageCountsResponse); rpc GetJobLogMessageCounts(GetJobLogMessageCountsRequest) returns (GetLogMessageCountsResponse); rpc QueryJobSpans(QueryJobSpansRequest) returns (PaginatedSpansData); }