Skip to content

vtselect: add support for Jaeger HTTP API v3 - #234

Open
Vandit1604 wants to merge 5 commits into
VictoriaMetrics:masterfrom
Vandit1604:jaeger-api-v3
Open

vtselect: add support for Jaeger HTTP API v3#234
Vandit1604 wants to merge 5 commits into
VictoriaMetrics:masterfrom
Vandit1604:jaeger-api-v3

Conversation

@Vandit1604

Copy link
Copy Markdown

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:

Jaeger UI v3 endpoints it calls
2.15 to 2.18 /api/v3/services, /api/v3/operations
2.19 and above those, plus /api/v3/trace-summaries for search

Single 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, traces and traces/{trace_id}.

Most of the data work already existed. rowsToResourceSpans built []*otelpb.ResourceSpans for the Tempo API from the same stored rows, so it moves to tracecommon and both APIs share it. The missing piece was an OTLP/JSON writer, since Tempo writes protobuf. That is lib/protoparser/opentelemetry/pb/traces_json.qtpl. The summary rollup follows Jaeger's own summarizeTrace for 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 /api the way the docs describe. Requests captured from the browser:

GET /api/v3/services                                        200
GET /api/v3/operations?service=frontend                     200
GET /api/v3/trace-summaries?query.serviceName=frontend&...  200
GET /api/v3/trace-summaries?...&query.attributes={...}      200
GET /api/traces/aa00...0002                                 200   v1
GET /api/dependencies?endTs=...&lookback=...                200   v1

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/traces and /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

spanKind on /api/v3/operations does not narrow the result, since the span name list is stored without the span kind. query.rawTraces does not change the result. Both are documented. Jaeger UI sends neither.

spanKind in the operations response is always internal, which is what Jaeger reports when its own storage has no value.

Tests

End-to-end tests in apptest for 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.

@cubic-dev-ai cubic-dev-ai Bot 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.

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

Comment thread docs/victoriatraces/querying/README.md
Comment thread apptest/model.go
if !jqp.StartTimeMax.IsZero() {
uv.Add("query.startTimeMax", jqp.StartTimeMax.Format(time.RFC3339Nano))
}
if jqp.SearchDepth > 0 {

@cubic-dev-ai cubic-dev-ai Bot Aug 9, 2026

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.

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>
Fix with cubic

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread apptest/model.go
Comment thread lib/protoparser/opentelemetry/pb/traces_json_test.go

@cubic-dev-ai cubic-dev-ai Bot 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.

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

Comment thread apptest/tests/jaeger_apiv3_test.go Outdated
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.

Jaeger UI 2.15+ broken: /api/v3/services endpoint returns "unsupported path"

1 participant