Skip to content
Open
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
21 changes: 18 additions & 3 deletions src/bitdrift/public/unary/admin/v1/view.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ syntax = "proto3";
package bitdrift.public.unary.admin.v1;

import "bitdrift/public/unary/admin/v1/access.proto";
import "bitdrift/public/unary/alerts/v1/alerts.proto";
import "bitdrift/public/unary/common/v1/common.proto";
import "bitdrift/public/unary/issues/v1/issues.proto";
import "bitdrift/public/unary/workflows/v1/workflow.proto";
Expand All @@ -30,6 +31,11 @@ message ViewFilters {
.bitdrift.public.unary.workflows.v1.WorkflowListQuery workflow_query = 1;
}

message AlertList {
// The filters saved for the unified Alerts list.
.bitdrift.public.unary.alerts.v1.AlertFilter filter = 1;
}

// Selects the saved criteria for one supported view type.
oneof type {
option (validate.required) = true;
Expand All @@ -38,6 +44,9 @@ message ViewFilters {

// The saved criteria for a workflow view.
.bitdrift.public.unary.admin.v1.ViewFilters.WorkflowList workflow_list = 3;

// The saved criteria for an Alert View.
.bitdrift.public.unary.admin.v1.ViewFilters.AlertList alert_list = 5;
}
}

Expand All @@ -50,6 +59,9 @@ message ViewSort {

// Orders workflow views using workflow list sort criteria.
.bitdrift.public.unary.workflows.v1.ListWorkflowsRequest.Sort workflow = 2;

// Orders Alert Views using unified alert list sort criteria.
.bitdrift.public.unary.alerts.v1.GetAlertsRequest.Sort alert = 3;
}
}

Expand Down Expand Up @@ -121,7 +133,7 @@ message UpsertViewRequest {
// The saved filters for the new view.
.bitdrift.public.unary.admin.v1.ViewFilters view_filters = 3 [(validate.rules).message = {required: true}];

// The default sort order for the new view.
// The default sort order for the new view. Alert Views support up to 8 sort criteria.
.bitdrift.public.unary.admin.v1.ViewSortList default_sort = 5;

// An optional icon to display for the new view.
Expand All @@ -142,10 +154,11 @@ message UpsertViewRequest {
// An optional replacement description for the view.
optional string description = 3 [(validate.rules).string = {max_len: 1000}];

// Optional replacement filters for the view.
// Optional replacement filters for the view. Updates cannot convert a view to or from an
// Alert View.
optional .bitdrift.public.unary.admin.v1.ViewFilters view_filters = 4;

// Optional replacement default sort criteria.
// Optional replacement default sort criteria. Alert Views support up to 8 sort criteria.
.bitdrift.public.unary.admin.v1.ViewSortList default_sort = 6;

// Optional replacement icon for the view.
Expand Down Expand Up @@ -220,6 +233,8 @@ message ListViewsRequest {
ISSUE_GROUP = 1;
// Returns workflow views.
WORKFLOWS = 2;
// Returns Alert Views.
ALERTS = 3;
}

// Selects which service's views to return.
Expand Down
11 changes: 11 additions & 0 deletions src/bitdrift/public/unary/alerts/v1/alerts.proto
Original file line number Diff line number Diff line change
Expand Up @@ -939,6 +939,17 @@ message GetAlertsRequest {

// Pagination parameters for the result set.
.bitdrift.public.unary.common.v1.Pagination pagination = 5;

// Applies a saved Alert View visible to the caller. Each field present in `filter` replaces
// the matching saved field; unset fields retain the saved value. Messages replace whole
// fields, and empty repeated fields do not override saved values. A non-empty `sort` replaces
// the saved sort. Pagination always comes from this request. Missing or hidden views return
// `NotFound`; views of another type are rejected. Requires view read permission in addition to
// alert read permission.
optional string view_id = 6 [(validate.rules).string = {
min_len: 1
max_len: 100
}];
}

// Describes a principal assigned to an alert.
Expand Down
37 changes: 37 additions & 0 deletions src/bitdrift/public/unary/alerts/v1/issue_alerts.proto
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,21 @@ import "validate/validate.proto";

// Defines the issue alert configuration for an issues view.
message IssuesAlertConfig {
// User-facing category, independent of the conditions used to evaluate the alert.
enum AlertType {
// Omit the optional category when it is unknown. Requests that explicitly supply this value
// are rejected.
ALERT_TYPE_UNSPECIFIED = 0;
// Category for alerts that monitor issue volume against a threshold.
ALERT_TYPE_FREQUENT_ERROR = 1;
// Category for alerts that monitor increases in issue volume.
ALERT_TYPE_TRENDING_ERROR = 2;
// Category for rate-limited notifications when a matching issue group first appears.
ALERT_TYPE_NEW_ERROR = 3;
// Category for rate-limited notifications when a matching issue event occurs.
ALERT_TYPE_EVERY_ERROR = 4;
}

// Groups multiple issue alert conditions under a logical operator.
message IssuesAlertConditionList {
// Conditions combined by the surrounding logical operator.
Expand Down Expand Up @@ -106,6 +121,14 @@ message IssuesAlertConfig {
min_len: 1
max_len: 255
}];

// Client-supplied category, preserved on save and returned unchanged. May be absent on
// existing alerts; the server does not infer or populate it from the alert ID or conditions.
// Evaluation continues to use the condition, independently of this category.
optional .bitdrift.public.unary.alerts.v1.IssuesAlertConfig.AlertType alert_type = 6 [(validate.rules).enum = {
defined_only: true
not_in: [0]
}];
}

// Rate limited notifications for new issue events within the view.
Expand All @@ -116,6 +139,20 @@ message IssuesAlertConfig {

// Alerts for the view.
repeated .bitdrift.public.unary.alerts.v1.IssuesAlertConfig.IssuesAlert alerts = 3 [(validate.rules).repeated = {max_items: 20}];

// Client-supplied category for new_issue_event_notification. Preserved unchanged when supplied;
// omitted values remain unset so clients can infer the category for existing configurations.
optional .bitdrift.public.unary.alerts.v1.IssuesAlertConfig.AlertType new_issue_event_alert_type = 4 [(validate.rules).enum = {
defined_only: true
not_in: [0]
}];

// Client-supplied category for new_issue_group_notification. Preserved unchanged when supplied;
// omitted values remain unset so clients can infer the category for existing configurations.
optional .bitdrift.public.unary.alerts.v1.IssuesAlertConfig.AlertType new_issue_group_alert_type = 5 [(validate.rules).enum = {
defined_only: true
not_in: [0]
}];
}

// Requests the issues alert configuration for a view.
Expand Down
10 changes: 10 additions & 0 deletions src/bitdrift/public/unary/charts/v1/chart_metadata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,16 @@ message ChartMetadata {

// Required for histogram-backed exports; counters must leave this unset.
.bitdrift.public.unary.charts.v1.ChartMetadata.MetricChartMetadata.TimeSeriesMetadata.ConnectorExportConfig.OtlpConnectorExportConfig.HistogramConfiguration histogram_configuration = 6;

// Optional, counter only, from 1 through 1440 minutes (24 hours). On a successful
// query, repeat the cumulative value for previously observed series with no activity.
// After this many quiet minutes, send a stale marker and forget the series. If charts
// share the same export, the longest configured timeout wins. If all omit it, the
// export stays sparse.
optional uint32 idle_timeout_minutes = 7 [(validate.rules).uint32 = {
gte: 1
lte: 1440
}];
}

message CloudwatchConnectorExportConfig {
Expand Down
12 changes: 12 additions & 0 deletions src/bitdrift/public/unary/common/v1/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
import "validate/validate.proto";

// A tag assigned to a resource.
message Tag {
// The raw value of the tag, used for filtering.
string value = 1 [(validate.rules).string = {
min_len: 1
max_len: 100
}];

// The principal who created this tag.
.bitdrift.public.unary.common.v1.Owner created_by = 2;
}

message Owner {
// The email address of this owner.
string email = 1 [(validate.rules).string = {max_len: 255}];
Expand Down
56 changes: 55 additions & 1 deletion src/bitdrift/public/unary/dashboards/v1/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,10 @@ message Dashboard {
}];

// The union of tags associated with the workflows referenced in this dashboard.
repeated .bitdrift.public.unary.workflows.v1.Workflow.WorkflowTag workflow_tags = 11 [(validate.rules).repeated = {max_items: 100}];
repeated .bitdrift.public.unary.common.v1.Tag workflow_tags = 11 [(validate.rules).repeated = {max_items: 100}];

// Tags assigned directly to this dashboard, independently of `workflow_tags`.
repeated .bitdrift.public.unary.common.v1.Tag tags = 12 [(validate.rules).repeated = {max_items: 100}];
}

oneof type {
Expand Down Expand Up @@ -1140,6 +1143,48 @@ message UpsertCustomDashboardRequest {
repeated .bitdrift.public.unary.workflows.v1.GroupBy.Value dashboard_variables = 5 [(validate.rules).repeated = {max_items: 10}];
}

message UpsertCustomDashboardTagsRequest {
// The ID of the custom dashboard to update.
string dashboard_id = 1 [(validate.rules).string = {
min_len: 1
max_len: 100
}];

// The complete set of direct dashboard tags. An empty set removes all direct tags.
// Values use the same tag catalog as workflows. Workflow assignments are unchanged.
repeated string tags = 2 [(validate.rules).repeated = {
max_items: 100
items: {
string: {
min_len: 1
max_len: 100
}
}
}];
}

message UpsertCustomDashboardTagsResponse {
// The direct dashboard tags after the update.
repeated .bitdrift.public.unary.common.v1.Tag tags = 1;
}

message ListDashboardTagOptionsRequest {
// When true, returns only tag values directly assigned to at least one dashboard.
// Otherwise, returns the shared dashboard and workflow tag catalog.
bool explicit_only = 1;

// Pagination for tag values in alphabetical order. The default page size is 100.
.bitdrift.public.unary.common.v1.TokenPagination pagination = 2;
}

message ListDashboardTagOptionsResponse {
// The tag options in the requested scope, from the shared catalog.
repeated .bitdrift.public.unary.common.v1.Tag tags = 1 [(validate.rules).repeated.max_items = 100];

// Continues listing tag values. Absent when no more values are available.
optional string next_page_token = 2 [(validate.rules).string.max_len = 4096];
}

// Response for `UpsertCustomDashboard`.
message UpsertCustomDashboardResponse {
// The saved dashboard.
Expand Down Expand Up @@ -1258,6 +1303,15 @@ service DashboardService {
// semantics for compatibility with older clients.
rpc UpsertCustomDashboard(.bitdrift.public.unary.dashboards.v1.UpsertCustomDashboardRequest) returns (.bitdrift.public.unary.dashboards.v1.UpsertCustomDashboardResponse);

// Replaces the tags assigned directly to a custom dashboard.
//
// Requires dashboard write permission and edit access. An empty tag set removes all direct
// tags. Tags inherited from workflows and the workflows themselves are unchanged.
rpc UpsertCustomDashboardTags(.bitdrift.public.unary.dashboards.v1.UpsertCustomDashboardTagsRequest) returns (.bitdrift.public.unary.dashboards.v1.UpsertCustomDashboardTagsResponse);

// Lists tag options from the shared dashboard and workflow catalog.
rpc ListDashboardTagOptions(.bitdrift.public.unary.dashboards.v1.ListDashboardTagOptionsRequest) returns (.bitdrift.public.unary.dashboards.v1.ListDashboardTagOptionsResponse);

// Deletes a custom dashboard.
rpc DeleteCustomDashboard(.bitdrift.public.unary.dashboards.v1.DeleteCustomDashboardRequest) returns (.bitdrift.public.unary.dashboards.v1.DeleteCustomDashboardResponse);

Expand Down
51 changes: 28 additions & 23 deletions src/bitdrift/public/unary/device_debug/v1/device_debug.proto
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ message SendDeviceCommandResponse {
}
}

// Requests a device command's status, optionally waiting for execution and upload to complete.
// Requests a device command's status, optionally waiting for execution, upload, and processing.
message GetDeviceCommandRequest {
// The opaque identifier returned by SendDeviceCommand.
string command_id = 1 [(validate.rules).string = {
Expand All @@ -120,16 +120,14 @@ message GetDeviceCommandRequest {
}];

// Maximum readiness wait in seconds, from 0 to 30. Omitted or zero returns immediately.
// Returns on success, failure, or expiry; a deadline returns the latest observed `pending`
// snapshot. Success confirms finalized original upload, not optional attachment processing.
// Returns on success, failure, or expiry. A wait timeout can return `pending` or `processing`.
// Set the transport timeout above this wait plus ordinary response latency.
optional uint32 wait_seconds = 2 [(validate.rules).uint32.lte = 30];
}

// Returns a snapshot of command state, upload progress, and terminal context, never attachment bytes.
//
// Poll while `pending`; stop on `succeeded`, `failed`, or `expired`. A successful command's declared
// attachment upload is complete, but optional server-side processing can still be pending.
// Poll while `pending` or `processing`; stop on `succeeded`, `failed`, or `expired`.
message GetDeviceCommandResponse {
// The command is awaiting execution, executing, or uploading its result. No partial attachment
// can be downloaded, even when progress reports persisted bytes.
Expand All @@ -138,11 +136,18 @@ message GetDeviceCommandResponse {
.google.protobuf.Timestamp updated_at = 1 [(validate.rules).message.required = true];
}

// Execution and upload have completed; required server-side processing is queued or running.
message Processing {
// The time of the latest execution or processing update.
.google.protobuf.Timestamp updated_at = 1 [(validate.rules).message.required = true];
}

// Describes a command that completed successfully.
//
// Success confirms that any declared attachment is fully uploaded and persisted, whether uploaded
// in one transfer or progressively. Its original logical contents are final and will not grow on
// later retrievals. If `attachment` is omitted, the command completed without an attachment; do
// later retrievals, and any required processing is complete. If `attachment` is omitted, the
// command completed without an attachment; do
// not keep polling for one. `GetDeviceCommand` never returns attachment bytes.
//
// When `attachment` is present, download it with
Expand All @@ -154,7 +159,9 @@ message GetDeviceCommandResponse {
// bytes. Set the transport timeout above this wait plus download time.
//
// Append `?variant=raw` for the finalized original attachment, or assembled log JSON. This skips
// optional processing, not the command-success requirement. Omit `variant` for the default
// processing but requires a finalized upload and successful device execution. Raw remains
// downloadable while processing, after processing failure, and after processing expiry, subject
// to retention. Omit `variant` for the default
// representation: an attachment without processing returns its original contents; an attachment
// with processing returns the processed result when ready. Processing still pending returns
// HTTP 409 with `Retry-After: 2` and a JSON `processing_state`. Failed processing returns a
Expand All @@ -173,8 +180,8 @@ message GetDeviceCommandResponse {
// Download HTTP 409 without a processing response means the command is still pending; poll
// `GetDeviceCommand` within a caller-chosen deadline. HTTP 404 can mean an unknown or unretained
// command, failed or expired execution, no attachment, or attachment bytes no longer retained.
// Status reads return HTTP 404 for unknown, unretained, failed, or expired commands; successful
// commands without attachments instead return HTTP 200 with `raw_available: false`.
// Command status reads return HTTP 404 for unknown or unretained commands. For the attachment
// status route, inspect `raw_available` and `processed_available` independently.
// HTTP 400 means an invalid UUID or download variant; correct the request. HTTP 401 requires
// authentication and HTTP 403 requires permission. These plain HTTP routes do not promise a
// uniform JSON error body.
Expand All @@ -187,8 +194,8 @@ message GetDeviceCommandResponse {
// Default, raw, and processed representations can differ. Finalized original contents are stable
// while retained, but identical HTTP serialization, compression, or headers are not guaranteed.
message Succeeded {
// Metadata for a fully uploaded, finalized original attachment, not its bytes. Optional
// processing can still be pending. Historical bytes may expire independently of this metadata.
// Metadata for a finalized original attachment, not its bytes. Historical bytes may expire
// independently of this metadata.
message Attachment {
// The MIME type of the original attachment. The download's Content-Type identifies the
// selected representation, which can differ after processing or a failure fallback.
Expand All @@ -206,7 +213,6 @@ message GetDeviceCommandResponse {
.bitdrift_public.protobuf.client.v1.DeviceCommandResultContext context = 3;

// The finalized attachment metadata. Omission means no attachment, not an upload still pending.
// Presence confirms completed upload, not completed processing or indefinite storage retention.
// Downloading bytes no longer retained returns HTTP 404.
.bitdrift.public.unary.device_debug.v1.GetDeviceCommandResponse.Succeeded.Attachment attachment = 4;
}
Expand All @@ -223,7 +229,7 @@ message GetDeviceCommandResponse {
optional string failure_message = 3 [(validate.rules).string.max_bytes = 4096];
}

// The execution deadline passed without a persisted terminal outcome.
// The command deadline passed before execution, upload, or required processing completed.
message Expired {
.google.protobuf.Timestamp expired_at = 1 [(validate.rules).message.required = true];
}
Expand All @@ -244,9 +250,11 @@ message GetDeviceCommandResponse {
// The command could not be completed.
.bitdrift.public.unary.device_debug.v1.GetDeviceCommandResponse.Failed failed = 5;

// Execution or upload expired. Recorded progress remains visible throughout history retention,
// but incomplete attachment contents cannot be downloaded.
// Execution, upload, or processing expired. Incomplete uploads cannot be downloaded.
.bitdrift.public.unary.device_debug.v1.GetDeviceCommandResponse.Expired expired = 6;

// The original upload is finalized; required processing has not finished.
.bitdrift.public.unary.device_debug.v1.GetDeviceCommandResponse.Processing processing = 7;
}
}

Expand Down Expand Up @@ -465,14 +473,11 @@ service DebugService {
// Retrieves the state and available results of a device command.
//
// Omit `wait_seconds` or use zero for an immediate snapshot. A positive value waits up to 30
// seconds for success, failure, or expiry; timeout returns the latest observed `pending` snapshot.
// Retry pending reads within a caller-chosen deadline. `failed` and `expired` are terminal.
// When `succeeded.attachment` is present, its original upload is complete and finalized; fetch
// bytes with `GET /v1/device-commands/{command_id}/attachment?variant=raw`, substituting
// `device_command.command_id`. No further upload polling is needed. Optional processing is a
// separate stage: inspect `GET /v1/device-commands/{command_id}/attachment/status`, or add
// `wait_seconds=1` through `wait_seconds=30` to the download to wait for its representation.
// A download wait timeout preserves HTTP 409; status-route reads remain immediate.
// seconds for success, failure, or expiry; a timeout can return `pending` or `processing`.
// Retry either state within a caller-chosen deadline. `failed` and `expired` are terminal.
// Fetch a finalized original with `GET /v1/device-commands/{command_id}/attachment?variant=raw`
// even when processing fails or expires. The attachment status route reports which variants
// are available. A download wait timeout preserves HTTP 409.
// See `GetDeviceCommandResponse.Succeeded`
// for variants, download headers, and HTTP 4xx meanings. Success without `attachment` means there
// is nothing to download. This method never includes attachment bytes or tracks workflow commands.
Expand Down
Loading
Loading