Skip to content

COBS-1290: Add Insights alert rules OpenAPI - #1225

Open
dmamidala-glitch wants to merge 9 commits into
digitalocean:mainfrom
dmamidala-glitch:cobs-1290-insights-alert-rules
Open

dmamidala-glitch wants to merge 9 commits into
digitalocean:mainfrom
dmamidala-glitch:cobs-1290-insights-alert-rules

Conversation

@dmamidala-glitch

@dmamidala-glitch dmamidala-glitch commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds public OpenAPI for Insights alert rule CRUD under /v2/insights/alert-rules.
  • Documents the current API's protobuf enum values for rule status, evaluation windows, threshold/filter operators, severities, and re-alert durations.
  • Retains dotted OTel metrics, the links/meta list envelope, page/per_page (default 20, max 200), and scopes insights:read|create|update|delete.
  • Documents 422 for underscored Prometheus-style metric names.

Test plan

  • make lint passes (0 Spectral errors)
  • Enum schemas and examples match the current staging API values
  • Align the RFC with the documented protobuf enum values
  • After merge, confirm docs regen publishes the new endpoints

Blocked by / ships after: COBS-1287 Edge routing.

Related: notification-channels draft #1224 (COBS-1289).

dmamidala-glitch and others added 4 commits September 16, 2026 12:27
Document public CRUD for /v2/insights/alert-rules against the api-service
contract and Edge scopes from COBS-1287.

Co-authored-by: Cursor <cursoragent@cursor.com>
Match staging: protobuf omitempty drops total when zero.

Co-authored-by: Cursor <cursoragent@cursor.com>
Use lowercase enums, duration strings, links/meta list envelope, and
dotted OTel metric guidance from the Alerts Public Insights API RFC.

Co-authored-by: Cursor <cursoragent@cursor.com>
dmamidala-glitch and others added 3 commits September 22, 2026 12:29
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
- `EVALUATION_WINDOW_30M` = `30m`
- `EVALUATION_WINDOW_1H` = `1h`
enum:
- EVALUATION_WINDOW_UNSPECIFIED

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you double if "EVALUATION_WINDOW_UNSPECIFIED" is a valid window?

description: |
Current alert rule status. Values use the API's protobuf enum names.

- `ALERT_RULE_STATUS_UNSPECIFIED` = unspecified

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same with this as well.

description: |
Desired alert rule status. Values use the API's protobuf enum names.

- `ALERT_RULE_STATUS_UNSPECIFIED` = unspecified

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment

Comparison operator applied to the aggregated metric value. Values use
the API's protobuf enum names.

- `THRESHOLD_OPERATOR_UNSPECIFIED` = unspecified

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

operator:
type: string
description: |
Comparison operator applied to the aggregated metric value. Values use

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, can you remove reference to protobuf. Internal details are not needed public API documentation.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants