vtselect: add support for Jaeger HTTP API v3 - #234
Conversation
There was a problem hiding this comment.
1 issue found across 18 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apptest/model.go">
<violation number="1" location="apptest/model.go:408">
P3: A zero `SearchDepth` is silently sent as absent, so tests request the server default rather than the valid zero-depth behavior. Represent presence separately from the integer value before encoding this field.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
| if !jqp.StartTimeMax.IsZero() { | ||
| uv.Add("query.startTimeMax", jqp.StartTimeMax.Format(time.RFC3339Nano)) | ||
| } | ||
| if jqp.SearchDepth > 0 { |
There was a problem hiding this comment.
P3: A zero SearchDepth is silently sent as absent, so tests request the server default rather than the valid zero-depth behavior. Represent presence separately from the integer value before encoding this field.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apptest/model.go, line 408:
<comment>A zero `SearchDepth` is silently sent as absent, so tests request the server default rather than the valid zero-depth behavior. Represent presence separately from the integer value before encoding this field.</comment>
<file context>
@@ -365,3 +372,212 @@ func NewLogsQLQueryResponse(t *testing.T, s string) *LogsQLQueryResponse {
+ if !jqp.StartTimeMax.IsZero() {
+ uv.Add("query.startTimeMax", jqp.StartTimeMax.Format(time.RFC3339Nano))
+ }
+ if jqp.SearchDepth > 0 {
+ uv.Add("query.searchDepth", strconv.Itoa(jqp.SearchDepth))
+ }
</file context>
There was a problem hiding this comment.
Leaving this as is. It matches JaegerQueryParam.asURLValues in the same file, which also skips a zero limit. Changing only the v3 helper would make the two disagree, and a search for zero traces is not a case worth testing.
There was a problem hiding this comment.
All reported issues were addressed across 6 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
Fixes #141.
Jaeger UI v2.15 and newer calls the Jaeger HTTP API v3. VictoriaTraces served only the v1 paths, so the UI failed.
Which version calls what:
/api/v3/services,/api/v3/operations/api/v3/trace-summariesfor searchSingle trace loading still uses the v1
/api/traces/{id}route, and the dependency graph has no v3 endpoint at all, so both keep working as before.What this adds
Five endpoints under
/select/jaeger/api/v3/:services,operations,trace-summaries,tracesandtraces/{trace_id}.Most of the data work already existed.
rowsToResourceSpansbuilt[]*otelpb.ResourceSpansfor the Tempo API from the same stored rows, so it moves totracecommonand both APIs share it. The missing piece was an OTLP/JSON writer, since Tempo writes protobuf. That islib/protoparser/opentelemetry/pb/traces_json.qtpl. The summary rollup follows Jaeger's ownsummarizeTracefor root, orphan and error counting, so the numbers mean the same thing as on a Jaeger backend.Verified against Jaeger UI 2.20.0
Ran the real UI against a local build, serving the UI assets and forwarding
/apithe way the docs describe. Requests captured from the browser:Service and operation dropdowns fill. Search returns the right traces with correct service breakdown, span counts, error counts and durations. A trace renders with the full span tree. The Tags box narrows results. The System Architecture graph renders. That session mixed v1 and v3, which is also the backward compatibility check.
Not exercised by any Jaeger UI
/api/v3/tracesand/api/v3/traces/{trace_id}are implemented and tested, but no UI version calls them today. They are part of the api_v3 service and the UI plans to move single trace loading onto v3, so they are included rather than left out. Nothing here depends on them.Accepted and ignored
spanKindon/api/v3/operationsdoes not narrow the result, since the span name list is stored without the span kind.query.rawTracesdoes not change the result. Both are documented. Jaeger UI sends neither.spanKindin the operations response is alwaysinternal, which is what Jaeger reports when its own storage has no value.Tests
End-to-end tests in
apptestfor every v3 endpoint, including the 404 shape, an absent service name, and attribute filters that match and do not match. Unit tests for the OTLP/JSON writer, the summary rollup, and the tag conversion shared by v1 and v3.