Skip to content

Combined Insights alerts OpenAPI: alert rules, alert instances, and notification channels - #1246

Merged
kishlay-singh-DO merged 15 commits into
digitalocean:insights_v2from
atalluri-do:combined-insights-alerts
Oct 1, 2026
Merged

kishlay-singh-DO merged 15 commits into
digitalocean:insights_v2from
atalluri-do:combined-insights-alerts

Conversation

@atalluri-do

@atalluri-do atalluri-do commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

This PR combines the Insights work from #1242, #1243, and #1244 into a single branch against the current insights_v2 target.

Included changes:

The POST variants of the PromQL endpoints were removed because they caused client-generation failures.

Conflicts between the branches were resolved while preserving the original authors' commits via cherry-pick.

Closes / supersedes #1242, #1243, and #1244.

dmamidala-glitch and others added 14 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>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Adds the read-only Insights alert instances endpoints:

- GET /v2/insights/alert-instances (list; filters: status, rule_id,
  resource_urn; standard page/per_page pagination with links/meta envelope)
- GET /v2/insights/alert-instances/{id}

Spec follows the agreed Alerts Public Insights API contract: snake_case
fields, lowercase enums (severity: warning|critical, status:
active|resolved), RFC 3339 timestamps, uuid identifiers, and the standard
DO list envelope via shared pages/meta components. Scope: insights:read,
matching the staging Edge routing for COBS-1287.

Co-authored-by: Cursor <cursoragent@cursor.com>
- Add Insights to x-tagGroups so the section renders in Redoc.
- Document that alert instances are ordered by triggered_at DESC and
  note the offset-pagination stability caveat on an append-only list.
- Mark alert_instance.resource_urn as optional and describe when it
  may be empty (non-resource-bound signals, e.g. cluster/pod/namespace-
  scoped Kubernetes alerts; see optionalResourceURN in
  executioner/pkg/alertrule/store.go).

Co-authored-by: Cursor <cursoragent@cursor.com>
Document the Prometheus-compatible query surface published at /v2/insights/query/{region}/prom/api/v1/*: instant query, range query, label names, label values, and series. GET and POST variants are documented where the public Edge routes accept both; every operation requires the insights:read scope.

Only the publicly routed endpoints are included -- metadata, format_query, and parse_query stay internal.

@kishlay-singh-DO kishlay-singh-DO left a comment

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.

For pydo we will need to make fix for the four methods that are there because AutoRest's Python generator does not implement application/x-www-form-urlencoded operations. It marks them abstract and emits raise_if_not_implemented for post_prom_query, post_prom_query_range, post_prom_labels, and post_prom_series.

@atalluri-do
atalluri-do force-pushed the combined-insights-alerts branch from 9a29b6a to c14840e Compare October 1, 2026 17:10
@kishlay-singh-DO
kishlay-singh-DO merged commit 6b51ace into digitalocean:insights_v2 Oct 1, 2026
5 of 6 checks passed
kishlay-singh-DO added a commit that referenced this pull request Oct 1, 2026
* Cobs 1289 insights notification channels (#1241)

* Add OpenAPI for Insights notification channels (COBS-1289)

Document public CRUD for /v2/insights/notification-channels against the
api-service contract and Edge scopes from COBS-1287.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Remove PagerDuty from Insights notification channels OpenAPI

Omit unsupported pagerduty channel type/config from the public spec.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Align Insights notification-channels OpenAPI with public RFC contract

Use lowercase channel types, write-only/masked secrets, and page/per_page
defaults from the Alerts Public Insights API RFC.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Document notification channel proto enum values

Co-authored-by: Cursor <cursoragent@cursor.com>

* Add notification channel enum references

Co-authored-by: Cursor <cursoragent@cursor.com>

* Address notification channels API review feedback

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Devender Mamidala <dmamidala@digitalocean.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

* Combined Insights alerts OpenAPI: alert rules, alert instances, and notification channels (#1246)

* Add OpenAPI for Insights alert rules (COBS-1290)

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>

* Fix Insights alert-rules pagination total optionality

Match staging: protobuf omitempty drops total when zero.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Align Insights alert-rules OpenAPI with public RFC contract

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>

* Document alert rule proto enum values

Co-authored-by: Cursor <cursoragent@cursor.com>

* Add alert rule enum references

Co-authored-by: Cursor <cursoragent@cursor.com>

* Address alert rules API review feedback

Co-authored-by: Cursor <cursoragent@cursor.com>

* Add OpenAPI spec for Insights alert instances (COBS-1288)

Adds the read-only Insights alert instances endpoints:

- GET /v2/insights/alert-instances (list; filters: status, rule_id,
  resource_urn; standard page/per_page pagination with links/meta envelope)
- GET /v2/insights/alert-instances/{id}

Spec follows the agreed Alerts Public Insights API contract: snake_case
fields, lowercase enums (severity: warning|critical, status:
active|resolved), RFC 3339 timestamps, uuid identifiers, and the standard
DO list envelope via shared pages/meta components. Scope: insights:read,
matching the staging Edge routing for COBS-1287.

Co-authored-by: Cursor <cursoragent@cursor.com>

* COBS-1288: Address review — tag group, sort docs, optional resource_urn

- Add Insights to x-tagGroups so the section renders in Redoc.
- Document that alert instances are ordered by triggered_at DESC and
  note the offset-pagination stability caveat on an append-only list.
- Mark alert_instance.resource_urn as optional and describe when it
  may be empty (non-resource-bound signals, e.g. cluster/pod/namespace-
  scoped Kubernetes alerts; see optionalResourceURN in
  executioner/pkg/alertrule/store.go).

Co-authored-by: Cursor <cursoragent@cursor.com>

* COBS-1342: Add public OpenAPI for Insights PromQL query endpoints

Document the Prometheus-compatible query surface published at /v2/insights/query/{region}/prom/api/v1/*: instant query, range query, label names, label values, and series. GET and POST variants are documented where the public Edge routes accept both; every operation requires the insights:read scope.

Only the publicly routed endpoints are included -- metadata, format_query, and parse_query stay internal.

* COBS-1347: Add public OpenAPI for Insights logs search endpoints

* Remove POST variants of PromQL endpoints to fix client generation

---------

Co-authored-by: Devender Mamidala <dmamidala@digitalocean.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: SSharma-10 <shivanisharma@digitalocean.com>
Co-authored-by: adityasingh <adityasingh@digitalocean.com>

---------

Co-authored-by: atalluri-do <atalluri@digitalocean.com>
Co-authored-by: Devender Mamidala <dmamidala@digitalocean.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: SSharma-10 <shivanisharma@digitalocean.com>
Co-authored-by: adityasingh <adityasingh@digitalocean.com>
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.

5 participants