Repository navigation
COBS-1350: Add Insights traces query support - #1162
Merged
kishlay-singh-DO merged 1 commit intoOct 12, 2026
Merged
kishlay-singh-DO merged 1 commit into
kishlay-singh-DO merged 1 commit into
Conversation
Add InsightsService.SearchTraces and GetTrace for the public traces query endpoints documented in digitalocean/openapi#1256.
srajputdo
force-pushed
the
sakshirajput/COBS-1350/traces-query
branch
from
October 12, 2026 09:50
581fef7 to
5c0f0c6
Compare
srajputdo
marked this pull request as ready for review
October 12, 2026 10:02
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 traces query endpoints, matching the OpenAPI spec merged in digitalocean/openapi#1256.
InsightsService.SearchTraces(ctx, region, *TracesSearchRequest)→POST /v2/insights/query/{region}/traces/searchInsightsService.GetTrace(ctx, region, traceID, *TraceGetOptions)→GET /v2/insights/query/{region}/traces/{trace_id}with optionalfrom/tolookup windowTracesSearchRequest,TracesTimeRange/TracesTimeBound,TracesFilterExpression,TracesFilterField,TracesFilterValue,TracesOrderBy,TracesPaginationRequest,TracesSearchResponse,TraceSummary,TracesPaginationResponse,TraceGetOptions,Trace,TraceSpancondition/and/or/not/text_search) with operatorseq/neq/gt/gte/lt/lte/in/existsTracesFilterValueencodes the typed-wrapper value form ({"type":"string","value":...}) and accepts the bare scalar/array form on decodeInsightsTraces*constants for filter node types, operators, scopes, sort directions, value types, and trace statusSearchTraces+GetTracechecks added toexamples/insights/smoke/main.goPlain-text error bodies from the traces service (
400,404 trace not found,502) surface asErrorResponse.Messagevia the existingCheckResponsefallback; covered by tests.Testing
Rebased on
mainafter #1156 (spans) merged; both clients coexist.Unit / CI-equivalent —
gofmt -sclean,go vet ./...clean,go test -race ./...passes on Go 1.23.12, 1.24.9 (CI matrix) and 1.27. New tests:TestInsights_SearchTraces,TestInsights_SearchTracesMinimalRequest,TestTracesFilterValueMarshal,TestTracesFilterValueUnmarshal,TestInsights_SearchTracesEscapesRegion,TestInsights_SearchTracesError,TestInsights_GetTrace,TestInsights_GetTraceNilOptions,TestInsights_GetTraceEscapesPath,TestInsights_GetTraceNotFound.Live —
examples/insights/smokepasses the traces checks on staging (s2r1) and prod (nyc2). A broader live matrix driven through this client against both environments: staging 59 passed / 2 skipped (no multi-span or second-region data), prod 61 passed, covering:now-168h), absolute RFC3339, absolute epoch-seconds time ranges; minimal body; summary field decodinglimit1 (hasMore=true), 0 (server default), 1000orderBystartedasc/desc anddurationNsdesc verified sorted;serviceName,traceId,errorCount,spanCount,status, aliases; multiple clauses; omitted directioneq,neq,in(string_array),exists,gt/gte/lt/lte, bool value, emptytype→ condition,resource/attributes/span.attributesscopes,text_search, nestedand/or/not, no-match → emptydata*ErrorResponsetimeRange, badorderByfield / direction,notwith 2 children,inwith scalar; 404 (plain text): unknown, uppercase, out-of-window and wrong-region trace IDs; 404 / 401 (gateway JSON): unknown region, bad tokenNote: the Insights query routes do not currently return the standard
ratelimit-*headers (also true for logs search), soResponse.Rateis empty for these calls. Tracking separately; no client change needed.Jira: https://do-internal.atlassian.net/browse/COBS-1350