Repository navigation
Conversation
Add dashboard CRUD and schema methods to InsightsService for the public
Insights dashboard endpoints served by insightssvc:
ListDashboards GET /v2/insights/dashboards
GetDashboard GET /v2/insights/dashboards/{uuid}
CreateDashboard POST /v2/insights/dashboards
UpdateDashboard PUT /v2/insights/dashboards/{uuid}
DeleteDashboard DELETE /v2/insights/dashboards/{uuid}
GetDashboardSchema GET /v2/insights/dashboards/schema
The API transports the dashboard spec as a JSON document serialized to
a string. Dashboard.Spec and DashboardRequest.Spec are json.RawMessage
so callers work with the document directly; MarshalJSON/UnmarshalJSON
convert to and from the wire string. DashboardRequest rejects an empty,
invalid, or already string-encoded spec before any request is sent.
Wire details follow the live grpc-gateway behaviour: every success is
200 (delete returns an empty object), zero-value fields are omitted,
list pagination uses pagination.* query parameters and returns a
pagination object rather than links/meta.
POST /v2/insights/dashboards/generate is intentionally not exposed; it
is not routed publicly.
Co-authored-by: Cursor <cursoragent@cursor.com>
adityasingh-beep
marked this pull request as draft
November 1, 2026 14:57
adityasingh-beep
marked this pull request as ready for review
November 2, 2026 06:59
SortDirection is only applied when Sort is set, where it defaults to ascending. Without a Sort the API orders by created_at descending and ignores SortDirection. Also note that an unknown SortDirection is a 400. Co-authored-by: Cursor <cursoragent@cursor.com>
Exercise GetDashboardSchema and ListDashboards on every run, and under INSIGHTS_SMOKE_WRITE=1 create, get, list sorted by name, duplicate (409), update, delete, and get after delete (404) a dashboard. The write gate for dashboards no longer requires INSIGHTS_EMAIL, which only the channel and alert rule writes need. Specs are compared semantically: the API stores them in a JSON column and returns them with normalized key order and whitespace. Co-authored-by: Cursor <cursoragent@cursor.com>
DO-rrao
approved these changes
Nov 4, 2026
This was referenced Nov 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Jira: https://do-internal.atlassian.net/browse/COBS-1891 · OpenAPI: digitalocean/openapi#1298
Adds dashboard support to
InsightsService:ListDashboards,GetDashboard,CreateDashboard,UpdateDashboard,DeleteDashboard, andGetDashboardSchema, following the existingListResources/GetResourcepattern.Worth knowing
Specis ajson.RawMessageholding the document itself, and godo converts to and from the string on the wire. An empty, invalid, or non-object spec is rejected client-side before any request goes out.pagination.*query params and returns apaginationobject instead oflinks/meta, so this has its ownDashboardListOptionsrather than reusing*ListOptions. Without aSort, results are newest first; with one, direction defaults to ascending.200, including create and delete. Unset fields likedescriptionare omitted.specin a JSON column, so reads come back with normalized key order and whitespace. godo doesn't reformat in either direction.Testing
Unit tests cover every method plus the client-side spec validation, path escaping, and a JSON round trip.
gofmt,go vet,go test ./...are clean.I also extended
examples/insights/smokeand ran it against staging (s2r1): schema and list on every run, and withINSIGHTS_SMOKE_WRITE=1the full create → get → sorted list → duplicate (409) → update → delete → get (404) cycle. All green, and it cleans up after itself.Not here
Dashboard error bodies are grpc-gateway shaped (
"error"is a string), whichErrorResponsedoesn't decode cleanly yet. Status codes anderrors.Aswork fine; the fix is in the sharedgodo.goand will be a separate PR. CHANGELOG goes in the release PR per CONTRIBUTING.