Repository navigation
COBS-1351: Add Insights spans query support - #1156
Merged
kishlay-singh-DO merged 2 commits intoOct 12, 2026
Merged
kishlay-singh-DO merged 2 commits into
kishlay-singh-DO merged 2 commits into
Conversation
Add a godo client for the public Insights spans search endpoint
(POST /v2/insights/query/{region}/spans/search): SearchSpans plus the
request/response types, filter grammar (condition/and/or/not/text_search),
and a SpansFilterValue that encodes the API's typed-wrapper value form.
Includes unit tests and a smoke-test check.
Co-authored-by: Cursor <cursoragent@cursor.com>
kishlay-singh-DO
approved these changes
Oct 12, 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.
Summary
Adds a godo client for the public Insights spans search endpoint, matching the OpenAPI spec merged in digitalocean/openapi#1259.
InsightsService.SearchSpans(ctx, region, *SpansSearchRequest)→POST /v2/insights/query/{region}/spans/searchSpansSearchRequest,SpansTimeRange/SpansTimeBound,SpansFilterExpression,SpansFilterField,SpansOrderBy,SpansPaginationRequest,SpansSearchResponse,SpanRecord,SpansPaginationResponsecondition/and/or/not/text_search, with operatorseq/neq/gt/gte/lt/lte/in/existsandresource/attributesfield scopesSpansFilterValueencodes the API's typed-wrapper value form ({"type":"string","value":...}) and also accepts the bare scalar/array form on decodeInsightsSpans*constants for the filter node types, operators, scopes, sort directions, and value typesSearchSpanscheck added toexamples/insights/smoke/main.goTesting
gofmt -s,go build ./...,go vet ./...,go test -race ./...all passTestInsights_SearchSpans,TestSpansFilterValueMarshal,TestSpansFilterValueUnmarshal,TestInsights_SearchSpansEscapesRegion,TestInsights_SearchSpansErrorin,exists, attribute/resource scopes, boolean trees,text_search, ordering) and the 7-day error case, via both the godo client and raw curl