From a19febdf00e451201ca6601e0a12567d7db1b8ae Mon Sep 17 00:00:00 2001 From: "bitdrift-proto-sync[bot]" <154373124+bitdrift-proto-sync[bot]@users.noreply.github.com> Date: Fri, 22 May 2026 21:25:33 +0000 Subject: [PATCH] Sync public API export @ b94e157 Automated sync of public API export. --- src/bitdrift/public/unary/admin/v1/api.proto | 16 + .../public/unary/admin/v1/notifications.proto | 199 +++++++ .../public/unary/admin/v1/permission.proto | 14 +- .../public/unary/alerts/v1/alerts.proto | 504 ++++++++++++++++++ .../public/unary/alerts/v1/issue_alerts.proto | 367 +++++++++++++ .../unary/alerts/v1/notifications.proto | 101 ++++ .../public/unary/common/v1/common.proto | 5 + .../public/unary/dashboards/v1/api.proto | 4 +- .../public/unary/timeline/v1/hydration.proto | 4 +- .../public/unary/workflows/v1/api.proto | 24 +- .../workflows/v1/captured_sessions.proto | 32 ++ .../public/unary/workflows/v1/workflow.proto | 8 +- .../public/webhook/v1/notification.proto | 6 + 13 files changed, 1251 insertions(+), 33 deletions(-) create mode 100644 src/bitdrift/public/unary/admin/v1/notifications.proto create mode 100644 src/bitdrift/public/unary/alerts/v1/alerts.proto create mode 100644 src/bitdrift/public/unary/alerts/v1/issue_alerts.proto create mode 100644 src/bitdrift/public/unary/alerts/v1/notifications.proto create mode 100644 src/bitdrift/public/unary/workflows/v1/captured_sessions.proto diff --git a/src/bitdrift/public/unary/admin/v1/api.proto b/src/bitdrift/public/unary/admin/v1/api.proto index 226c01b..ff87bbf 100644 --- a/src/bitdrift/public/unary/admin/v1/api.proto +++ b/src/bitdrift/public/unary/admin/v1/api.proto @@ -10,9 +10,25 @@ package bitdrift.public.unary.admin.v1; import "bitdrift/public/unary/admin/v1/connector.proto"; import "bitdrift/public/unary/admin/v1/keys.proto"; +import "bitdrift/public/unary/admin/v1/notifications.proto"; // Manages administrative settings including Slack integrations, notification groups, views, API/SDK keys, users, teams, and connectors. service AdminService { + // Lists all notification groups for the organization. + rpc GetNotificationGroups(.bitdrift.public.unary.admin.v1.GetNotificationGroupsRequest) returns (.bitdrift.public.unary.admin.v1.GetNotificationGroupsResponse); + + // Creates or updates a notification group for the organization. + rpc UpsertNotificationGroup(.bitdrift.public.unary.admin.v1.UpsertNotificationGroupRequest) returns (.bitdrift.public.unary.admin.v1.UpsertNotificationGroupResponse); + + // Deletes a notification group for the organization. + rpc DeleteNotificationGroup(.bitdrift.public.unary.admin.v1.DeleteNotificationGroupRequest) returns (.bitdrift.public.unary.admin.v1.DeleteNotificationGroupResponse); + + // Sends a test notification to all targets in a notification group. + rpc TestNotificationGroup(.bitdrift.public.unary.admin.v1.TestNotificationGroupRequest) returns (.bitdrift.public.unary.admin.v1.TestNotificationGroupResponse); + + // Sends a test alert notification to validate formatting and mentions. + rpc TestAlertNotification(.bitdrift.public.unary.admin.v1.TestAlertNotificationRequest) returns (.bitdrift.public.unary.admin.v1.TestAlertNotificationResponse); + // Lists the API and SDK keys available to the authenticated user. rpc GetKeys(.bitdrift.public.unary.admin.v1.GetKeysRequest) returns (.bitdrift.public.unary.admin.v1.GetKeysResponse); diff --git a/src/bitdrift/public/unary/admin/v1/notifications.proto b/src/bitdrift/public/unary/admin/v1/notifications.proto new file mode 100644 index 0000000..362794e --- /dev/null +++ b/src/bitdrift/public/unary/admin/v1/notifications.proto @@ -0,0 +1,199 @@ +// api - bitdrift's client/server API definitions +// Copyright Bitdrift, Inc. All rights reserved. +// +// Use of this source code and APIs are governed by a source available license that can be found in +// the LICENSE file or at: +// https://polyformproject.org/wp-content/uploads/2020/06/PolyForm-Shield-1.0.0.txt +syntax = "proto3"; + +package bitdrift.public.unary.admin.v1; + +import "google/protobuf/timestamp.proto"; +import "validate/validate.proto"; + +// Defines a reusable set of notification targets for the organization. +message NotificationGroup { + // Describes a PagerDuty target in a notification group. + message PagerDutyNotification { + enum PagerDutySeverity { + CRITICAL = 0; + ERROR = 1; + WARNING = 2; + INFO = 3; + } + + // Routing key for the PagerDuty integration to notify. + string routing_key = 1 [(validate.rules).string = { + min_len: 1 + max_len: 255 + }]; + + // Severity sent with the PagerDuty incident. + .bitdrift.public.unary.admin.v1.NotificationGroup.PagerDutyNotification.PagerDutySeverity severity = 2 [(validate.rules).enum = {defined_only: true}]; + } + + // Describes a Datadog On-Call target in a notification group. + message DataDogNotification { + enum DataDogSeverity { + SEVERITY_UNSPECIFIED = 0; + LOW = 1; + HIGH = 2; + } + + // The base URL for the DataDog On-Call API, for example https://navy.oncall.datadoghq.com. + string api_base_url = 1 [(validate.rules).string = { + min_len: 1 + max_len: 255 + }]; + + // The DataDog API key. GetNotificationGroups returns this as after creation. + // UpsertNotificationGroup accepts to preserve the stored value for an existing + // target. + string api_key = 2 [(validate.rules).string = { + min_len: 1 + max_len: 255 + }]; + + // The DataDog application key. GetNotificationGroups returns this as after + // creation. UpsertNotificationGroup accepts to preserve the stored value for an + // existing target. + string application_key = 3 [(validate.rules).string = { + min_len: 1 + max_len: 255 + }]; + + // The DataDog team handle to page. + string team_handle = 4 [(validate.rules).string = { + min_len: 1 + max_len: 255 + }]; + + // The requested paging urgency. + .bitdrift.public.unary.admin.v1.NotificationGroup.DataDogNotification.DataDogSeverity severity = 5 [(validate.rules).enum = {defined_only: true}]; + } + + // The name of the notification group. Must be unique. + string name = 1 [(validate.rules).string = { + min_len: 1 + max_len: 255 + }]; + + // The list of Slack channel names that are members of the notification group. + repeated string slack_channels = 2 [(validate.rules).repeated = {max_items: 100}]; + + // The list of PagerDuty targets that are members of the notification group. + repeated .bitdrift.public.unary.admin.v1.NotificationGroup.PagerDutyNotification pager_duty_notifications = 3 [(validate.rules).repeated = {max_items: 100}]; + + // The list of email addresses that are members of the notification group. + repeated string email_addresses = 4 [(validate.rules).repeated = {max_items: 100}]; + + // The list of SNS topic ARNs that are members of the notification group. + repeated string sns_topic_arns = 5 [(validate.rules).repeated = {max_items: 100}]; + + // The list of DataDog On-Call targets that are members of the notification group. + repeated .bitdrift.public.unary.admin.v1.NotificationGroup.DataDogNotification datadog_notifications = 6 [(validate.rules).repeated = {max_items: 100}]; +} + +// Requests the notification groups configured for the organization. +message GetNotificationGroupsRequest {} + +// Returns the notification groups configured for the organization. +message GetNotificationGroupsResponse { + // Describes a notification group together with its creation and usage timestamps. + message NotificationGroupWithMetadata { + // The notification group. + .bitdrift.public.unary.admin.v1.NotificationGroup notification_group = 1; + + // The time the notification group was created. + .google.protobuf.Timestamp created_at = 2; + + // The time the notification group was last used. + .google.protobuf.Timestamp used_at = 3; + } + + // The list of notification groups. + repeated .bitdrift.public.unary.admin.v1.GetNotificationGroupsResponse.NotificationGroupWithMetadata notification_groups = 1; +} + +// Requests creation or replacement of a notification group. +message UpsertNotificationGroupRequest { + // The notification group to upsert. + .bitdrift.public.unary.admin.v1.NotificationGroup notification_group = 1 [(validate.rules).message = {required: true}]; +} + +// Confirms that the notification group was created or updated. +message UpsertNotificationGroupResponse {} + +// Requests deletion of a notification group. +message DeleteNotificationGroupRequest { + // The name of the notification group to delete. + string name = 1 [(validate.rules).string = { + min_len: 1 + max_len: 255 + }]; +} + +// Confirms that the notification group was deleted. +message DeleteNotificationGroupResponse {} + +// Requests a test notification for a notification group. +message TestNotificationGroupRequest { + // The name of the notification group to test. + string name = 1 [(validate.rules).string = { + min_len: 1 + max_len: 255 + }]; +} + +// Returns any errors encountered while sending a test notification group message. +message TestNotificationGroupResponse { + // The list of errors that occurred while sending the test notification. + repeated string errors = 1; +} + +// Describes a workflow alert notification to send as a test. +message WorkflowAlertTest { + // Workflow ID used to build links in the test notification. + string workflow_id = 2 [(validate.rules).string = { + min_len: 1 + max_len: 255 + }]; +} + +// Describes an issues alert notification to send as a test. +message IssuesAlertTest { + // View ID associated with the issues alert. + int64 view_id = 1 [(validate.rules).int64 = {gt: 0}]; + + // Alert UUID to use when formatting the test notification. + optional string alert_uuid = 2 [(validate.rules).string = { + min_len: 1 + max_len: 255 + }]; +} + +// Requests a test alert notification using the selected alert type and notification groups. +message TestAlertNotificationRequest { + // Selects which alert type to send as a test notification. + oneof alert_kind { + option (validate.required) = true; + // Uses workflow alert formatting for the test notification. + .bitdrift.public.unary.admin.v1.WorkflowAlertTest workflow_alert = 1; + + // Uses issues alert formatting for the test notification. + .bitdrift.public.unary.admin.v1.IssuesAlertTest issues_alert = 2; + } + + // Optional custom notification text exactly like alert CommonAlertConfig.custom_notification_text + // formatting (used to test Slack mentions). If empty, no extra text is appended. + string custom_notification_text = 3 [(validate.rules).string = {max_len: 2048}]; + + // The selected notification groups for the alert. + repeated string notification_group_names = 4 [(validate.rules).repeated = {max_items: 100}]; +} + +// Returns any errors encountered while sending a test alert notification. +message TestAlertNotificationResponse { + // Errors encountered while attempting to send the test alert. + repeated string errors = 1; +} diff --git a/src/bitdrift/public/unary/admin/v1/permission.proto b/src/bitdrift/public/unary/admin/v1/permission.proto index bde09ec..b6d5acd 100644 --- a/src/bitdrift/public/unary/admin/v1/permission.proto +++ b/src/bitdrift/public/unary/admin/v1/permission.proto @@ -24,14 +24,14 @@ enum Permission { WORKFLOW_DEPLOY = 5; // Allows reading session/timeline data. SESSION_READ = 7; - // Allows reading issue report data. - ISSUE_READ = 8; // Allows reading metrics data. METRIC_READ = 9; // Allows managing issue company settings. ISSUE_ADMIN = 11; // Allows reading user data for issue assignment. ISSUE_ASSIGN = 12; + // Allows reading issue report data. + ISSUE_READ = 8; // Allows managing connectors. CONNECTOR_ADMIN = 14; // Allows reading connectors. @@ -42,4 +42,14 @@ enum Permission { SYSTEM_STATUS_READ = 18; // Allows creating, editing, and deleting issue workflows that the user owns. ISSUE_WORKFLOW_WRITE = 19; + // Allows creating, editing, and deleting any alert and notification configuration. + ALERT_ADMIN = 20; + // Allows reading alert and notification configuration. + ALERT_READ = 21; + // Allows creating, editing, and deleting alert and notification configuration that the user owns. + ALERT_WRITE = 22; + // Allows reading notification groups. + NOTIFICATION_GROUP_READ = 23; + // Allows creating, editing, and deleting notification groups. + NOTIFICATION_GROUP_ADMIN = 24; } diff --git a/src/bitdrift/public/unary/alerts/v1/alerts.proto b/src/bitdrift/public/unary/alerts/v1/alerts.proto new file mode 100644 index 0000000..12b213b --- /dev/null +++ b/src/bitdrift/public/unary/alerts/v1/alerts.proto @@ -0,0 +1,504 @@ +// api - bitdrift's client/server API definitions +// Copyright Bitdrift, Inc. All rights reserved. +// +// Use of this source code and APIs are governed by a source available license that can be found in +// the LICENSE file or at: +// https://polyformproject.org/wp-content/uploads/2020/06/PolyForm-Shield-1.0.0.txt +syntax = "proto3"; + +package bitdrift.public.unary.alerts.v1; + +import "bitdrift/public/shared/workflows/v1/time_series.proto"; +import "bitdrift/public/unary/alerts/v1/notifications.proto"; +import "bitdrift/public/unary/charts/v1/chart_id.proto"; +import "bitdrift/public/unary/common/v1/common.proto"; +import "bitdrift/public/unary/dashboards/v1/api.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "validate/validate.proto"; + +enum ThresholdCondition { + ABOVE = 0; + BELOW = 1; +} + +// An alert definition global for an individual metric aggregated ID. This is shared across N +// workflows/charts if all of those workflows/charts refer to the same aggregated ID. +message BasicAlertConfig { + // The threshold value for the alert that will cause the alert to trigger. + double threshold = 1; + + // The condition that the threshold must meet for the alert to trigger. + .bitdrift.public.unary.alerts.v1.ThresholdCondition condition = 2 [(validate.rules).enum = {defined_only: true}]; + + // The window over which the alert will be evaluated. Currently supported windows include: 5 + // minutes, 1 hour, and 1 day. Regardless of the window, alerts are currently evaluated every 5 + // minutes. + .google.protobuf.Duration window = 3 [(validate.rules).duration.gt = {}]; + + // The number of consecutive data points that must meet the threshold condition for the alert to + // trigger. The aggregation window of each point depends on the evaluation window. For 5 minute + // and 1 hour evaluation windows, the aggregation window is 1 minute. For the 24 hour evaluation + // window, the aggregation window is 15 minutes. If not set defaults to 1. + optional uint32 consecutive_data_points = 4; + + // Configuration for any histogram values within the aggregate ID. This is required if the + // aggregate ID refers to a histogram so that one or more percentiles can be used as part of the + // alert condition. + .bitdrift.public.unary.charts.v1.HistogramConfiguration histogram_configuration = 5; + + // Optional limit strategy to use for this alert. If this is omitted, a default value of limiting + // by a top k of 5 entries is used. Ultimately this will allow alerting on specific dimensions + // for a group by aggregate ID if desired. + .bitdrift.public.unary.charts.v1.LimitStrategy limit_strategy = 6; + + // If specified, the alert will only trigger if at least this many unique devices are present in + // each consecutive data point that breaches the threshold condition. + optional uint32 unique_device_threshold = 7; +} + +// SLO alerts can only be defined on rate time series. The config will be failed otherwise. The +// Rate is assumed to be / . Ultimately the windows and burn rates +// are what drives alerting, but the SLO duration is still required so that error budget +// consumption can be calculated. Additionally, we can use the SLO duration to show SLO adherence +// over the trailing window if we like. +message SloAlertConfig { + // SLO alerts use MWMBR (Multi-Window/Multi-Burn Rate). Each alert evaluation looks at every + // WindowAndBurnRate and alerts if any of them alert. For an individual WindowAndBurnRate to alert + // both the short window AND long window must breach based on the SLO target and burn rate. + message WindowAndBurnRate { + // Overrides the default notification settings for this burn-rate window. + message OverrideNotifications { + // Notification targets for the alert when this OverrideNotifications is used. + repeated .bitdrift.public.unary.alerts.v1.RateLimitedNotificationConfig notifications = 1 [(validate.rules).repeated = {max_items: 100}]; + + // Custom notification text to use when this OverrideNotifications is used. If not set, + // the CommonAlertConfig.custom_notification_text will be used. + optional string custom_notification_text = 2 [(validate.rules).string = {max_len: 2048}]; + } + + // Short evaluation window for this burn-rate policy. + .google.protobuf.Duration short_window = 1 [(validate.rules).duration.gt = {}]; + + // Long evaluation window for this burn-rate policy. + .google.protobuf.Duration long_window = 2 [(validate.rules).duration.gt = {}]; + + // Burn rate threshold that causes this policy to trigger. + double burn_rate = 3; + + // Notification targets for the alert when this WindowAndBurnRate triggers. If unset, the + // CommonAlertConfig.notifications will be used. + .bitdrift.public.unary.alerts.v1.SloAlertConfig.WindowAndBurnRate.OverrideNotifications notifications = 4; + } + + // Currently only supports 7 days and 30 days. + .google.protobuf.Duration slo_duration = 1 [(validate.rules).duration.gt = {}]; + + // A percentage expressed as a number between 0 and 1. E.g., 0.99 for 99% or 0.95 for 95%. + double slo_target = 2; + + // Optional limit strategy to use for this alert. If this is omitted, a default value of limiting + // by a top k of 5 entries is used. Ultimately this will allow alerting on specific dimensions + // for a group by aggregate ID if desired. + .bitdrift.public.unary.charts.v1.LimitStrategy limit_strategy = 3; + + // The list of window and burn rates to use for the SLO alert. Each WindowAndBurnRate defines a + // short and long window, as well as a burn rate. The alert will trigger if any of the + // WindowAndBurnRates breach the SLO target based on the burn rate. + repeated .bitdrift.public.unary.alerts.v1.SloAlertConfig.WindowAndBurnRate window_and_burn_rates = 4 [(validate.rules).repeated = { + min_items: 1 + max_items: 10 + }]; +} + +// Rate of change alerts are used to look at significant changes over a period of time. They work +// for counter, rate, and histogram chart types. +message RateOfChangeAlertConfig { + enum ChangeDirection { + INCREASE = 0; + DECREASE = 1; + } + + oneof window_type { + option (validate.required) = true; + // This comparison type defines a window. [now - window, now] is compared to + // [now - 2 * window, now - window]. + .google.protobuf.Duration window = 1 [(validate.rules).duration.gt = {}]; + } + + oneof comparison_type { + option (validate.required) = true; + // This compares an absolute amount of change when the data is aggregated across each of the + // comparison windows. + double absolute_change = 2; + + // This compares a percentage of change when the data is aggregated across each of the + // comparison windows. + double percentage_change = 3; + } + + // The direction of change to check for. + .bitdrift.public.unary.alerts.v1.RateOfChangeAlertConfig.ChangeDirection change_direction = 4 [(validate.rules).enum = {defined_only: true}]; + + // Configuration for any histogram values within the aggregate ID. This is required if the + // aggregate ID refers to a histogram so that one or more percentiles can be used as part of the + // alert condition. + .bitdrift.public.unary.charts.v1.HistogramConfiguration histogram_configuration = 5; + + // Optional limit strategy to use for this alert. If this is omitted, a default value of limiting + // by a top k of 5 entries is used. Ultimately this will allow alerting on specific dimensions + // for a group by aggregate ID if desired. + .bitdrift.public.unary.charts.v1.LimitStrategy limit_strategy = 6; +} + +// Defines caller-visible alert metadata shared by all alert types. +message CommonAlertConfig { + // Short name for the alert. + string name = 1 [(validate.rules).string = { + min_len: 1 + max_len: 255 + }]; + + // Long form description for the alert. + string description = 2 [(validate.rules).string = {max_len: 2048}]; + + // Notification targets for the alert. + repeated .bitdrift.public.unary.alerts.v1.RateLimitedNotificationConfig notifications = 3 [(validate.rules).repeated = {max_items: 100}]; + + // If not empty, this text will be appended to the notification text for the alert when the + // notification is sent. + string custom_notification_text = 4 [(validate.rules).string = {max_len: 2048}]; + + // Optional labels to attach to the alert. For notification channels that support structured data + // (e.g. PagerDuty and SNS), these labels can be used to provide additional context for the alert. + map labels = 5 [(validate.rules).map.max_pairs = 20]; +} + +// Defines a workflow alert together with its shared metadata and alert type. +message AlertConfig { + // Shared metadata and notification settings for the alert. + .bitdrift.public.unary.alerts.v1.CommonAlertConfig common_config = 1 [(validate.rules).message.required = true]; + + oneof alert_type { + option (validate.required) = true; + // Configuration for a basic alert. + .bitdrift.public.unary.alerts.v1.BasicAlertConfig basic_alert = 5; + + // Configuration for an SLO alert. + .bitdrift.public.unary.alerts.v1.SloAlertConfig slo_alert = 6; + + // Configuration for a rate of change alert. + .bitdrift.public.unary.alerts.v1.RateOfChangeAlertConfig rate_of_change_alert = 7; + } +} + +// Requests the alert configuration for a workflow chart. +message GetAlertConfigRequest { + // The workflow ID to get the configuration for. + string workflow_id = 2 [(validate.rules).string = { + min_len: 1 + max_len: 255 + }]; + + // The chart rule ID to get the configuration for. + string chart_rule_id = 3 [(validate.rules).string = { + min_len: 1 + max_len: 255 + }]; +} + +// Returns the alert configurations for a workflow chart. +message GetAlertConfigResponse { + // Describes a stored alert configuration together with its identifier and state. + message AlertConfigWithId { + // The ID of the alert configuration. + uint64 id = 1; + + // Stored alert configuration. + .bitdrift.public.unary.alerts.v1.AlertConfig config = 6; + + // Whether the alert is disabled + bool disabled = 3; + + // The aggregated action ID the alert targets. + string aggregated_action_id = 4; + + // The owner of the alert. + .bitdrift.public.unary.common.v1.Owner owner = 5; + } + + // The list of alert configurations. + repeated .bitdrift.public.unary.alerts.v1.GetAlertConfigResponse.AlertConfigWithId alert_configs = 1; +} + +// Requests creation, update, or deletion of an alert configuration. +message UpsertAlertConfigRequest { + // The workflow ID to upsert the configuration for. + string workflow_id = 2 [(validate.rules).string = { + min_len: 1 + max_len: 255 + }]; + + // The chart rule ID to upsert the configuration for. + string chart_rule_id = 3 [(validate.rules).string = { + min_len: 1 + max_len: 255 + }]; + + // The aggregated action ID to upsert the configuration for. + string aggregated_action_id = 4 [(validate.rules).string = { + min_len: 1 + max_len: 255 + }]; + + // The ID of the alert configuration to upsert. If empty a new alert config will be created. + optional uint64 id = 5; + + // Alert configuration to create or update. + .bitdrift.public.unary.alerts.v1.AlertConfig alert_config = 8; + + // Whether to enable or disable the alert as part of the upsert. + bool disabled = 7; +} + +// Returns the identifier of the alert configuration that was changed. +message UpsertAlertConfigResponse { + // The ID of the upserted or deleted alert configuration. + uint64 id = 1; +} + +enum WorkflowAlertType { + BASIC = 0; + SLO = 1; + RATE_OF_CHANGE = 2; +} + +// Filters the list of workflow alerts by ownership, firing state, or alert type. +message AllAlertsFilter { + // Matches alerts owned by the authenticated user. + message Owned {} + + // Matches alerts that are currently firing. + message Firing {} + + // Matches alerts that are not currently firing. + message NotFiring {} + + oneof type { + option (validate.required) = true; + // Filters on whether the current user owns the alert. + .bitdrift.public.unary.alerts.v1.AllAlertsFilter.Owned owned = 1; + + // Filters on whether the alert is firing. + .bitdrift.public.unary.alerts.v1.AllAlertsFilter.Firing firing = 2; + + // Filters on whether the alert is not firing. + .bitdrift.public.unary.alerts.v1.AllAlertsFilter.NotFiring not_firing = 3; + + // Filters on a specific alert type. + .bitdrift.public.unary.alerts.v1.WorkflowAlertType alert_type = 4 [(validate.rules).enum = {defined_only: true}]; + } +} + +// Requests a paginated list of workflow alerts for the organization. +message GetAllAlertsRequest { + // Describes one caller-visible ordering criterion for workflow alert results. + message Sort { + enum SortKey { + SORT_KEY_UNSPECIFIED = 0; + ALERT_NAME = 1; + LAST_TRIGGERED = 2; + LAST_RESOLVED = 3; + OWNER_NAME = 4; + } + + // Selects which caller-visible alert attribute to order by. + .bitdrift.public.unary.alerts.v1.GetAllAlertsRequest.Sort.SortKey key = 1 [(validate.rules).enum = { + defined_only: true + not_in: [0] + }]; + + // Selects whether results are returned in ascending or descending order. + .bitdrift.public.unary.common.v1.SortDirection direction = 2 [(validate.rules).enum = {defined_only: true}]; + } + + // Used to paginate through results. To get the next page result, set this to + // the desired starting offset. For example, setting to 10 will start with the + // 10th record. The default value is 0. + optional uint32 offset = 1; + + // This defines the upper bound of the number of items returned. The maximum + // value supported is 100, meaning that we’ll never return more than + // max(items.count, limit, 100). + optional uint32 limit = 2 [(validate.rules).uint32 = { + gte: 1 + lte: 100 + }]; + + // Filter the list of alerts based on the current user's relationship to + // the alert. This is a logical AND. If no filters are supplied, all + // alerts are returned. + repeated .bitdrift.public.unary.alerts.v1.AllAlertsFilter filters = 3 [(validate.rules).repeated = {max_items: 100}]; + + // Deprecated: use sort instead. + repeated .bitdrift.public.unary.common.v1.Sort sort_by = 4 [ + deprecated = true, + (validate.rules).repeated = {max_items: 100} + ]; + + // Orders alerts by caller-visible attributes. Apply criteria in the order provided. + repeated .bitdrift.public.unary.alerts.v1.GetAllAlertsRequest.Sort sort = 5 [(validate.rules).repeated = {max_items: 100}]; +} + +// Returns a paginated list of workflow alerts for the organization. +message GetAllAlertsResponse { + // Describes one workflow alert in the list response. + message Item { + // Short name of the alert. + string alert_name = 1; + + // Unique identifier of the alert. + uint64 alert_id = 2; + + // Workflow ID the alert belongs to. + string workflow_id = 4; + + // Chart rule ID the alert belongs to. + string chart_rule_id = 5; + + // Aggregated action ID evaluated by the alert. + string aggregated_action_id = 6; + + // Whether the alert is currently disabled. + bool disabled = 7; + + // Time when the alert most recently triggered. + .google.protobuf.Timestamp last_triggered_at = 8; + + // Time when the alert most recently resolved. + .google.protobuf.Timestamp last_resolved_at = 9; + + // Owner information for the alert. + .bitdrift.public.unary.common.v1.Owner owner = 10; + + // Alert type used by this alert. + .bitdrift.public.unary.alerts.v1.WorkflowAlertType alert_type = 11; + } + + // Workflow alerts returned for the requested page. + repeated .bitdrift.public.unary.alerts.v1.GetAllAlertsResponse.Item items = 1; + + // Total number of workflow alerts that match the request. + uint32 total_alerts = 2; +} + +// Requests alert history for a single workflow alert. +message GetAlertHistoryRequest { + // The alert ID to get the history for. + uint64 alert_id = 1; + + // Used to paginate through results. To get the next page result, set this to + // the desired starting offset. For example, setting to 10 will start with the + // 10th record. The default value is 0. + optional uint32 offset = 2; + + // This defines the upper bound of the number of items returned. The maximum + // value supported is 100, meaning that we’ll never return more than + // max(items.count, limit, 100). + optional uint32 limit = 3 [(validate.rules).uint32 = { + gte: 1 + lte: 100 + }]; + + // The start time and end time of the alert history. + // All alerts that were firing within the time range will be returned, regardless of whether they + // were triggered before the start time or resolved after the end time. + optional .google.protobuf.Timestamp start_time = 4 [(validate.rules).message = {required: true}]; + + // End of the time range to return alert history for. + optional .google.protobuf.Timestamp end_time = 5 [(validate.rules).message = {required: true}]; +} + +// Describes why an alert triggered and what data contributed to it. +message AlertHistoryDetails { + // In the case of group by this might return multiple items. + // Describes the data points that contributed to a basic alert trigger. + message BasicContributingData { + // The data points that contributed to the alert. For grouped alerts, the response may include + // multiple time series. + repeated .bitdrift.public.shared.workflows.v1.DataPoint data_points = 1; + } + + // Describes the burn-rate data that contributed to an SLO alert trigger. + message SloContributingData { + // Burn-rate window configuration that triggered the alert. + .bitdrift.public.unary.alerts.v1.SloAlertConfig.WindowAndBurnRate window_and_burn_rate = 1; + + // Short-window comparison data for the alert trigger. + .bitdrift.public.unary.dashboards.v1.Table short_table = 2; + + // Long-window comparison data for the alert trigger. + .bitdrift.public.unary.dashboards.v1.Table long_table = 3; + } + + // Wraps the contributing data for whichever alert type triggered. + message ContributingData { + // Selects the contributing data format for the triggered alert type. + oneof data { + // Contributing data for a basic alert. + .bitdrift.public.unary.alerts.v1.AlertHistoryDetails.BasicContributingData basic = 1; + + // Contributing data for an SLO alert. + .bitdrift.public.unary.alerts.v1.AlertHistoryDetails.SloContributingData slo = 2; + } + } + + // If the alert was triggered by a group by dimension, this will contain the dimensions that + // triggered the alert. + repeated string group_by_dimensions = 1; + + // If there were errors sending notifications for the alert, they will be listed here. + repeated string notification_failures = 2; + + // Alert configuration snapshot captured when the alert triggered. + .bitdrift.public.unary.alerts.v1.AlertConfig alert_config = 4; + + // The data points that contributed to the alert being triggered. + repeated .bitdrift.public.unary.alerts.v1.AlertHistoryDetails.ContributingData contributing_data = 5; +} + +// Returns the alert history for a single workflow alert. +message GetAlertHistoryResponse { + // Describes one firing interval in the alert history. + message AlertHistoryItem { + // The time the alert was triggered. + .google.protobuf.Timestamp triggered_at = 1; + + // The time the alert was resolved. + .google.protobuf.Timestamp resolved_at = 2; + + // Additional details related to the firing of the alert. + .bitdrift.public.unary.alerts.v1.AlertHistoryDetails details = 3; + } + + // Alert history items that match the request. + repeated .bitdrift.public.unary.alerts.v1.GetAlertHistoryResponse.AlertHistoryItem history = 1; + + // Total number of alert history items that match the request. + uint32 total_alert_history = 2; +} + +// Provides workflow alert configuration, listing, and history operations. +service AlertsService { + // Gets alert configuration for a workflow chart. + rpc GetAlertConfig(.bitdrift.public.unary.alerts.v1.GetAlertConfigRequest) returns (.bitdrift.public.unary.alerts.v1.GetAlertConfigResponse); + + // Upserts alert configuration for a workflow chart. + rpc UpsertAlertConfig(.bitdrift.public.unary.alerts.v1.UpsertAlertConfigRequest) returns (.bitdrift.public.unary.alerts.v1.UpsertAlertConfigResponse); + + // Lists workflow alerts for the organization. + rpc GetAllAlerts(.bitdrift.public.unary.alerts.v1.GetAllAlertsRequest) returns (.bitdrift.public.unary.alerts.v1.GetAllAlertsResponse); + + // Gets history for a single workflow alert. + rpc GetAlertHistory(.bitdrift.public.unary.alerts.v1.GetAlertHistoryRequest) returns (.bitdrift.public.unary.alerts.v1.GetAlertHistoryResponse); +} diff --git a/src/bitdrift/public/unary/alerts/v1/issue_alerts.proto b/src/bitdrift/public/unary/alerts/v1/issue_alerts.proto new file mode 100644 index 0000000..6a4e9e9 --- /dev/null +++ b/src/bitdrift/public/unary/alerts/v1/issue_alerts.proto @@ -0,0 +1,367 @@ +// api - bitdrift's client/server API definitions +// Copyright Bitdrift, Inc. All rights reserved. +// +// Use of this source code and APIs are governed by a source available license that can be found in +// the LICENSE file or at: +// https://polyformproject.org/wp-content/uploads/2020/06/PolyForm-Shield-1.0.0.txt +syntax = "proto3"; + +package bitdrift.public.unary.alerts.v1; + +import "bitdrift/public/unary/alerts/v1/alerts.proto"; +import "bitdrift/public/unary/alerts/v1/notifications.proto"; +import "bitdrift/public/unary/common/v1/common.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "validate/validate.proto"; + +// Defines the issue alert configuration for an issues view. +message IssuesAlertConfig { + // Groups multiple issue alert conditions under a logical operator. + message IssuesAlertConditionList { + // Conditions combined by the surrounding logical operator. + repeated .bitdrift.public.unary.alerts.v1.IssuesAlertConfig.IssuesAlertCondition conditions = 1 [(validate.rules).repeated = { + min_items: 2 + max_items: 20 + }]; + } + + // Defines a count threshold that must be met within a duration. + message CountOverDuration { + // Minimum count required during the duration. + uint64 count = 1; + + // Duration over which the count is evaluated. + .google.protobuf.Duration duration = 2; + } + + // Defines a percentage threshold that must be met within a duration. + message PercentOverDuration { + // Minimum percentage required during the duration. + double percent = 1; + + // Duration over which the percentage is evaluated. + .google.protobuf.Duration duration = 2; + } + + // Defines the condition that controls when an issues alert fires. + message IssuesAlertCondition { + // Selects the condition type used by the issues alert. + oneof condition_type { + option (validate.required) = true; + // All conditions must be met for the alert to fire. + .bitdrift.public.unary.alerts.v1.IssuesAlertConfig.IssuesAlertConditionList and_conditions = 1; + + // Any of the conditions must be met for the alert to fire. + .bitdrift.public.unary.alerts.v1.IssuesAlertConfig.IssuesAlertConditionList or_conditions = 2; + + // A count of events over a duration required for the alert to fire. + .bitdrift.public.unary.alerts.v1.IssuesAlertConfig.CountOverDuration event_threshold = 3; + + // A count of unique devices over a duration required for the alert to fire. + .bitdrift.public.unary.alerts.v1.IssuesAlertConfig.CountOverDuration unique_device_threshold = 4; + + // A count of unique sessions over a duration required for the alert to fire. + .bitdrift.public.unary.alerts.v1.IssuesAlertConfig.CountOverDuration unique_session_threshold = 5; + + // A percentage of events compared to app opens over a duration required for the alert to + // fire. The app open metric will only be filtered by the platform and app ID. + .bitdrift.public.unary.alerts.v1.IssuesAlertConfig.PercentOverDuration event_to_app_open_threshold = 6; + + // A percentage of unique sessions with events compared to overall unique sessions over a + // duration required for the alert to fire. The unique session metric will only be filtered by + // the platform and app ID. + .bitdrift.public.unary.alerts.v1.IssuesAlertConfig.PercentOverDuration event_unique_sessions_to_overall_unique_sessions_threshold = 7; + + // A rate of change of events over a duration required for the alert to fire. + .bitdrift.public.unary.alerts.v1.RateOfChangeAlertConfig event_rate_of_change = 8; + + // A percentage of unique devices with events compared to overall unique devices over a + // duration required for the alert to fire. The unique device metric will only be filtered by + // the platform and app ID. + .bitdrift.public.unary.alerts.v1.IssuesAlertConfig.PercentOverDuration event_unique_devices_to_overall_unique_devices_threshold = 9; + } + } + + // Defines one issues alert attached to the view. + message IssuesAlert { + // Shared metadata and notification settings for the alert. + .bitdrift.public.unary.alerts.v1.CommonAlertConfig common_config = 1 [(validate.rules).message.required = true]; + + // If false, the alert applies globally (across all issue groups). If true, the alert applies + // individually within every issue group. + bool per_issue_group = 2; + + // The condition for the alert to fire. + .bitdrift.public.unary.alerts.v1.IssuesAlertConfig.IssuesAlertCondition condition = 3 [(validate.rules).message.required = true]; + + // Whether the alert is disabled or not. + bool disabled = 4; + + // The unique identifier for the alert. This only needs to be unique within a view. This is + // used to associate history data with this alert. The ID should be kept consistent across + // modifications where the expectation is the history will be preserved. + string alert_uuid = 5 [(validate.rules).string = { + min_len: 1 + max_len: 255 + }]; + } + + // Rate limited notifications for new issue events within the view. + repeated .bitdrift.public.unary.alerts.v1.RateLimitedNotificationConfig new_issue_event_notification = 1 [(validate.rules).repeated = {max_items: 20}]; + + // Notifications for new issue groups within the view. + repeated .bitdrift.public.unary.alerts.v1.RateLimitedNotificationConfig new_issue_group_notification = 2 [(validate.rules).repeated = {max_items: 20}]; + + // Alerts for the view. + repeated .bitdrift.public.unary.alerts.v1.IssuesAlertConfig.IssuesAlert alerts = 3 [(validate.rules).repeated = {max_items: 20}]; +} + +// Requests the issues alert configuration for a view. +message GetIssuesAlertConfigRequest { + // The issues view ID that the config is associated with. There can only be a single alert + // configuration per view ID. The view ID provides the filters used for the overall alert + // including at minimum platform and app ID. + string view_id = 1 [(validate.rules).string = { + min_len: 1 + max_len: 255 + }]; +} + +// Returns the issues alert configuration for a view. +message GetIssuesAlertConfigResponse { + // Describes caller-visible state for one alert in the configuration. + message PerAlertInfo { + // Stable UUID for the alert. + string alert_uuid = 1; + + // Time when the alert most recently triggered. + .google.protobuf.Timestamp last_triggered_at = 2; + + // Time when the alert most recently resolved. + .google.protobuf.Timestamp last_resolved_at = 3; + } + + // Returns the alert configuration for the issues view ID. + .bitdrift.public.unary.alerts.v1.IssuesAlertConfig alert_config = 1; + + // Per alert information on top of the stored configuration. + repeated .bitdrift.public.unary.alerts.v1.GetIssuesAlertConfigResponse.PerAlertInfo per_alert_info = 2; +} + +// Requests creation, update, or deletion of an issues alert configuration. +message UpsertIssuesAlertConfigRequest { + // The issues view ID that the config is associated with. + string view_id = 1 [(validate.rules).string = { + min_len: 1 + max_len: 255 + }]; + + // If provided, the config will either be created or updated based on the view ID. If not + // provided the alert config will be deleted. + .bitdrift.public.unary.alerts.v1.IssuesAlertConfig alert_config = 2; +} + +// Confirms that the issues alert configuration was updated. +message UpsertIssuesAlertConfigResponse {} + +// Filters the list of issues alerts by firing state or view. +message AllIssueAlertsFilter { + // Matches issues alerts that are currently firing. + message Firing {} + + // Matches issues alerts that are not currently firing. + message NotFiring {} + + // Matches issues alerts belonging to the selected views. + message View { + // View IDs to include in the result. + repeated string view_ids = 1 [(validate.rules).repeated = { + min_items: 1 + max_items: 100 + }]; + } + + oneof type { + option (validate.required) = true; + // Filters on whether the alert is firing. + .bitdrift.public.unary.alerts.v1.AllIssueAlertsFilter.Firing firing = 1; + + // Filters on whether the alert is not firing. + .bitdrift.public.unary.alerts.v1.AllIssueAlertsFilter.NotFiring not_firing = 2; + + // Filters on specific views. + .bitdrift.public.unary.alerts.v1.AllIssueAlertsFilter.View view = 3; + } +} + +// Requests a paginated list of issues alerts for the organization. +message GetAllIssueAlertsRequest { + // Describes one caller-visible ordering criterion for issues alert results. + message Sort { + enum SortKey { + SORT_KEY_UNSPECIFIED = 0; + VIEW_NAME = 1; + ALERT_NAME = 2; + LAST_TRIGGERED = 3; + } + + // Selects which caller-visible issue alert attribute to order by. + .bitdrift.public.unary.alerts.v1.GetAllIssueAlertsRequest.Sort.SortKey key = 1 [(validate.rules).enum = { + defined_only: true + not_in: [0] + }]; + + // Selects whether results are returned in ascending or descending order. + .bitdrift.public.unary.common.v1.SortDirection direction = 2 [(validate.rules).enum = {defined_only: true}]; + } + + // Used to paginate through results. To get the next page result, set this to + // the desired starting offset. For example, setting to 10 will start with the + // 10th record. The default value is 0. + optional uint32 offset = 1; + + // This defines the upper bound of the number of items returned. The maximum + // value supported is 100, meaning that we’ll never return more than + // max(items.count, limit, 100). + optional uint32 limit = 2 [(validate.rules).uint32 = { + gte: 1 + lte: 100 + }]; + + // Filter the list of alerts based on the current user's relationship to + // the alert. This is a logical AND. If no filters are supplied, all + // alerts are returned. + repeated .bitdrift.public.unary.alerts.v1.AllIssueAlertsFilter filters = 3 [(validate.rules).repeated = {max_items: 100}]; + + // Deprecated: use sort instead. + repeated .bitdrift.public.unary.common.v1.Sort sort_by = 4 [ + deprecated = true, + (validate.rules).repeated = {max_items: 100} + ]; + + // Orders issue alerts by caller-visible attributes. Apply criteria in the order provided. + repeated .bitdrift.public.unary.alerts.v1.GetAllIssueAlertsRequest.Sort sort = 5 [(validate.rules).repeated = {max_items: 100}]; +} + +// Returns a paginated list of issues alerts for the organization. +message GetAllIssueAlertsResponse { + // Describes one issues alert in the list response. + message Item { + // View ID the alert belongs to. + string view_id = 1; + + // Name of the view the alert belongs to. + string view_name = 2; + + // Short name of the alert. + string alert_name = 3; + + // Description of the alert. + string alert_description = 4; + + // Stable UUID for the alert. + string alert_uuid = 5; + + // Whether the alert is currently disabled. + bool disabled = 6; + + // Time when the alert most recently triggered. + .google.protobuf.Timestamp last_triggered_at = 7; + + // Time when the alert most recently resolved. + .google.protobuf.Timestamp last_resolved_at = 8; + } + + // Issues alerts returned for the requested page. + repeated .bitdrift.public.unary.alerts.v1.GetAllIssueAlertsResponse.Item items = 1; + + // Total number of issues alerts that match the request. + uint32 total_alerts = 2; +} + +// Requests alert history for a single issues alert. +message GetIssueAlertHistoryRequest { + // The issues view ID that the alert is associated with. + string view_id = 1 [(validate.rules).string = { + min_len: 1 + max_len: 255 + }]; + + // The alert UUID that the history is being requested for. + string alert_uuid = 2 [(validate.rules).string = { + min_len: 1 + max_len: 255 + }]; + + // The start time and end time of the alert history. + // All alerts that were firing within the time range will be returned, regardless of whether they + // were triggered before the start time or resolved after the end time. + optional .google.protobuf.Timestamp start_time = 4 [(validate.rules).message = {required: true}]; + + // End of the time range to return issues alert history for. + optional .google.protobuf.Timestamp end_time = 5 [(validate.rules).message = {required: true}]; +} + +// Describes one issues alert firing interval together with its contributing issue groups. +message IssueAlertHistoryDetails { + // If there were errors sending notifications for the alert, they will be listed here. + repeated string notification_failures = 1; + + // The configuration of the alert at the time it was triggered. + .bitdrift.public.unary.alerts.v1.IssuesAlertConfig.IssuesAlert alert_config = 2; + + // The issue groups that contributed to the alert. For alerts that are per-issue group, this is + // all impacted groups. For alerts that are not per-issue group, this is effectively a list + // of all issue groups that had activity during the alert period. + repeated string issue_group_ids = 3; +} + +// Returns the alert history for a single issues alert. +message GetIssueAlertHistoryResponse { + // Describes one firing interval in the issues alert history. + message AlertHistoryItem { + // The time the alert was triggered. + .google.protobuf.Timestamp triggered_at = 1; + + // The time the alert was resolved. + .google.protobuf.Timestamp resolved_at = 2; + + // Additional details related to the firing of the alert. + .bitdrift.public.unary.alerts.v1.IssueAlertHistoryDetails details = 3; + } + + // Summarizes one issue group that contributed to alerting during the time range. + message IssueGroupSummary { + // The issue group ID that can be used to look up additional group details. + string group_id = 1; + + // The number of alert events associated with the group during the time range. + uint32 alert_count = 2; + + // The time the group last contributed to a triggered alert. + .google.protobuf.Timestamp last_triggered_at = 3; + } + + // The history of the alert during the time range specified in the request. Used to draw a time + // series like chart. + repeated .bitdrift.public.unary.alerts.v1.GetIssueAlertHistoryResponse.AlertHistoryItem history = 1; + + // A summary of the issue groups that contributed to alerting during the time range. + repeated .bitdrift.public.unary.alerts.v1.GetIssueAlertHistoryResponse.IssueGroupSummary issue_groups = 2; +} + +// Provides issues alert configuration, listing, and history operations. +service IssuesAlertsService { + // Gets the alert configuration for an issues view. + rpc GetAlertConfig(.bitdrift.public.unary.alerts.v1.GetIssuesAlertConfigRequest) returns (.bitdrift.public.unary.alerts.v1.GetIssuesAlertConfigResponse); + + // Upserts the alert configuration for an issues view. + rpc UpsertAlertConfig(.bitdrift.public.unary.alerts.v1.UpsertIssuesAlertConfigRequest) returns (.bitdrift.public.unary.alerts.v1.UpsertIssuesAlertConfigResponse); + + // Lists issues alerts for the organization. + rpc GetAllAlerts(.bitdrift.public.unary.alerts.v1.GetAllIssueAlertsRequest) returns (.bitdrift.public.unary.alerts.v1.GetAllIssueAlertsResponse); + + // Gets history for a single issues alert. + rpc GetAlertHistory(.bitdrift.public.unary.alerts.v1.GetIssueAlertHistoryRequest) returns (.bitdrift.public.unary.alerts.v1.GetIssueAlertHistoryResponse); +} diff --git a/src/bitdrift/public/unary/alerts/v1/notifications.proto b/src/bitdrift/public/unary/alerts/v1/notifications.proto new file mode 100644 index 0000000..a8784f0 --- /dev/null +++ b/src/bitdrift/public/unary/alerts/v1/notifications.proto @@ -0,0 +1,101 @@ +// api - bitdrift's client/server API definitions +// Copyright Bitdrift, Inc. All rights reserved. +// +// Use of this source code and APIs are governed by a source available license that can be found in +// the LICENSE file or at: +// https://polyformproject.org/wp-content/uploads/2020/06/PolyForm-Shield-1.0.0.txt +syntax = "proto3"; + +package bitdrift.public.unary.alerts.v1; + +import "google/protobuf/duration.proto"; +import "validate/validate.proto"; + +// Configuration for a notification that is sent in response to an alert condition. Alert conditions +// include session capture notifications, chart alerts, etc. +message AlertNotificationConfig { + // Identifies a notification group target for an alert notification. + message NotificationGroup { + // The name of the notification group configured for the organization. + string name = 1 [(validate.rules).string = { + min_len: 1 + max_len: 255 + }]; + } + + oneof notification_type { + option (validate.required) = true; + // Sends notifications to a notification group. + .bitdrift.public.unary.alerts.v1.AlertNotificationConfig.NotificationGroup notification_group = 3; + } + + // Whether the notification is currently disabled/muted. + bool disabled = 4; +} + +// Configures alert notification delivery together with its rate limit. +message RateLimitedNotificationConfig { + // The minimum time between notifications for the same alert target. If unset, the server uses + // a default interval of 5 minutes. + .google.protobuf.Duration min_time_between_notifications = 1; + + // The notification target and channel settings for this notification. + .bitdrift.public.unary.alerts.v1.AlertNotificationConfig notification_config = 2; +} + +// Lists the session capture notifications configured for a workflow rule. +message SessionCaptureNotificationConfigList { + // The list of session capture notification configurations. + repeated .bitdrift.public.unary.alerts.v1.RateLimitedNotificationConfig session_capture_notification_configs = 1 [(validate.rules).repeated = {max_items: 100}]; +} + +// Requests the session capture notification settings for a workflow rule. +message GetCapturedSessionNotificationRequest { + // The action ID for the session capture rule to get the configuration for. + string action_id = 1 [(validate.rules).string = { + min_len: 1 + max_len: 255 + }]; + + // The workflow ID for the workflow rule to get the configuration for. + string workflow_id = 3 [(validate.rules).string = { + min_len: 1 + max_len: 255 + }]; +} + +// Returns the session capture notification settings for a workflow rule. +message GetCapturedSessionNotificationResponse { + // The notification configuration for the session capture rule. + .bitdrift.public.unary.alerts.v1.SessionCaptureNotificationConfigList notifications = 1 [(validate.rules).message = {required: true}]; +} + +// Requests creation or replacement of session capture notification settings for a workflow rule. +message UpsertCapturedSessionNotificationRequest { + // The action ID for the session capture rule to upsert the configuration for. + string action_id = 1 [(validate.rules).string = { + min_len: 1 + max_len: 255 + }]; + + // The notification configuration to upsert. + .bitdrift.public.unary.alerts.v1.SessionCaptureNotificationConfigList notifications = 2 [(validate.rules).message = {required: true}]; + + // The workflow ID for the workflow rule to upsert the configuration for. + string workflow_id = 4 [(validate.rules).string = { + min_len: 1 + max_len: 255 + }]; +} + +// Confirms that the session capture notification settings were updated. +message UpsertCapturedSessionNotificationResponse {} + +// Manages session capture notification settings for workflow rules. +service NotificationsService { + // Gets the notification configuration for a session capture rule within a workflow. + rpc GetCapturedSessionNotification(.bitdrift.public.unary.alerts.v1.GetCapturedSessionNotificationRequest) returns (.bitdrift.public.unary.alerts.v1.GetCapturedSessionNotificationResponse); + + // Upserts the notification configuration for a session capture rule within a workflow. + rpc UpsertCapturedSessionNotification(.bitdrift.public.unary.alerts.v1.UpsertCapturedSessionNotificationRequest) returns (.bitdrift.public.unary.alerts.v1.UpsertCapturedSessionNotificationResponse); +} diff --git a/src/bitdrift/public/unary/common/v1/common.proto b/src/bitdrift/public/unary/common/v1/common.proto index d4933a6..749dc82 100644 --- a/src/bitdrift/public/unary/common/v1/common.proto +++ b/src/bitdrift/public/unary/common/v1/common.proto @@ -27,6 +27,11 @@ enum SortDirection { DESCENDING = 1; } +// Deprecated: use request-specific sort messages with enumerated sort keys instead of raw fields. +message Sort { + option deprecated = true; +} + message Pagination { // The starting offset for pagination. For example, set this to 10 to start // with the 10th record. Defaults to 0. diff --git a/src/bitdrift/public/unary/dashboards/v1/api.proto b/src/bitdrift/public/unary/dashboards/v1/api.proto index c18a2a1..65207de 100644 --- a/src/bitdrift/public/unary/dashboards/v1/api.proto +++ b/src/bitdrift/public/unary/dashboards/v1/api.proto @@ -79,8 +79,8 @@ message ResolvedChart { } message GetWorkflowChartsRequest { - // The ID or slug of the workflow to fetch the dashboard for. - string workflow_id_or_slug = 2 [ + // The ID of the workflow to fetch the charts for. + string workflow_id = 2 [ (validate.rules).string.min_len = 1, (validate.rules).string.max_len = 4096 ]; diff --git a/src/bitdrift/public/unary/timeline/v1/hydration.proto b/src/bitdrift/public/unary/timeline/v1/hydration.proto index b297f23..bb760c9 100644 --- a/src/bitdrift/public/unary/timeline/v1/hydration.proto +++ b/src/bitdrift/public/unary/timeline/v1/hydration.proto @@ -57,7 +57,9 @@ message HydrateSessionResponse { // Whether the hydration request is ignored because the session is already hydrated or is currently hydrating. bool ignored = 1; - // Whether the hydration request is successful. + // Whether the hydration request is successful. If the session is unknown, this will be set to + // false and additional information about the session will be provided in the + // session_not_found_info field. bool success = 2; // The most recent hydration state for the session. This is useful when the diff --git a/src/bitdrift/public/unary/workflows/v1/api.proto b/src/bitdrift/public/unary/workflows/v1/api.proto index 1e4bbd3..1bcd3b2 100644 --- a/src/bitdrift/public/unary/workflows/v1/api.proto +++ b/src/bitdrift/public/unary/workflows/v1/api.proto @@ -11,8 +11,8 @@ package bitdrift.public.unary.workflows.v1; import "bitdrift/public/shared/workflows/v1/time_series.proto"; import "bitdrift/public/unary/charts/v1/chart_metadata.proto"; import "bitdrift/public/unary/common/v1/common.proto"; +import "bitdrift/public/unary/workflows/v1/captured_sessions.proto"; import "bitdrift/public/unary/workflows/v1/workflow.proto"; -import "google/protobuf/timestamp.proto"; import "validate/validate.proto"; // Manages workflows and their lifecycle, including creation, deployment, and configuration. @@ -86,28 +86,8 @@ message FetchCapturedSessionsRequest { } message FetchCapturedSessionsResponse { - message CapturedSession { - // The unique identifier of the captured session. - string session_id = 1 [(validate.rules).string = {min_len: 1}]; - - // The timestamp of the first log seen for this session. - .google.protobuf.Timestamp first_seen = 2 [(validate.rules).message = {required: true}]; - - // The timestamp of the most recent log seen for this session. - .google.protobuf.Timestamp last_seen = 7 [(validate.rules).message = {required: true}]; - - // The number of times the session was seen. This will always be set to 1 when performing a - // global search. For a per-action search, it will effectively return the number of trigger logs - // for the session. - uint64 count = 4; - - // The fields associated with the captured session. They are similar to the - // fields in the insights. - map fields = 5; - } - // The captured sessions that matched the request. - repeated .bitdrift.public.unary.workflows.v1.FetchCapturedSessionsResponse.CapturedSession captured_sessions = 2; + repeated .bitdrift.public.unary.workflows.v1.CapturedSession captured_sessions = 2; // The total number of matching sessions before pagination, subject to // service limits. diff --git a/src/bitdrift/public/unary/workflows/v1/captured_sessions.proto b/src/bitdrift/public/unary/workflows/v1/captured_sessions.proto new file mode 100644 index 0000000..b451a05 --- /dev/null +++ b/src/bitdrift/public/unary/workflows/v1/captured_sessions.proto @@ -0,0 +1,32 @@ +// api - bitdrift's client/server API definitions +// Copyright Bitdrift, Inc. All rights reserved. +// +// Use of this source code and APIs are governed by a source available license that can be found in +// the LICENSE file or at: +// https://polyformproject.org/wp-content/uploads/2020/06/PolyForm-Shield-1.0.0.txt +syntax = "proto3"; + +package bitdrift.public.unary.workflows.v1; + +import "google/protobuf/timestamp.proto"; +import "validate/validate.proto"; + +message CapturedSession { + // The unique identifier of the captured session. + string session_id = 1 [(validate.rules).string = {min_len: 1}]; + + // The timestamp of the first log seen for this session. + .google.protobuf.Timestamp first_seen = 2 [(validate.rules).message = {required: true}]; + + // The timestamp of the most recent log seen for this session. + .google.protobuf.Timestamp last_seen = 7 [(validate.rules).message = {required: true}]; + + // The number of times the session was seen. This will always be set to 1 when performing a + // global search. For a per-action search, it will effectively return the number of trigger logs + // for the session. + uint64 count = 4; + + // The fields associated with the captured session. They are similar to the fields in the + // insights. + map fields = 5; +} diff --git a/src/bitdrift/public/unary/workflows/v1/workflow.proto b/src/bitdrift/public/unary/workflows/v1/workflow.proto index 464a66b..a6d4ff1 100644 --- a/src/bitdrift/public/unary/workflows/v1/workflow.proto +++ b/src/bitdrift/public/unary/workflows/v1/workflow.proto @@ -1669,12 +1669,8 @@ message Violation { } message GetWorkflowRequest { - // The slug or ID of the parent exploration. This is mapped to the REST path. - string exploration_slug_or_id = 1 [(validate.rules).string = {max_len: 100}]; - - // The slug or ID of the workflow to retrieve. We'll try to match both and - // return the first one that matches. This is mapped to the REST path. - string workflow_slug_or_id = 2 [(validate.rules).string = {max_len: 100}]; + // The ID of the workflow to retrieve. + string workflow_id = 2 [(validate.rules).string = {max_len: 100}]; } message GetWorkflowResponse { diff --git a/src/bitdrift/public/webhook/v1/notification.proto b/src/bitdrift/public/webhook/v1/notification.proto index ae400c9..b1331d6 100644 --- a/src/bitdrift/public/webhook/v1/notification.proto +++ b/src/bitdrift/public/webhook/v1/notification.proto @@ -79,6 +79,9 @@ message AlertNotification { // Custom notification text. string custom_notification_text = 6; + + // Additional labels attached to the alert. + map labels = 7; } // Describes an issue referenced by an issue webhook notification. @@ -120,6 +123,9 @@ message IssueAlertNotification { // Custom notification text. string custom_notification_text = 6; + + // Additional labels attached to the alert. + map labels = 7; } // Describes a webhook notification for a newly created issue report.