Repository navigation
[BUGFIX] Jaeger plugin: use the Jaeger API v3 to support Jaeger 2.21+ - #870
Open
AnKiT-GaRG2 wants to merge 2 commits into
Open
AnKiT-GaRG2 wants to merge 2 commits into
AnKiT-GaRG2 wants to merge 2 commits into
Conversation
Jaeger 2.21 removed the v1 query endpoints (/api/services, /api/operations, /api/traces), which the Jaeger datasource and trace query plugins called. Against Jaeger 2.21 and later every request answers 404. Call the API v3 endpoints instead. The v3 responses already use OTLP, so the conversion from the Jaeger JSON model is replaced by a normalisation of the OTLP enums, and the spans returned together for a search are grouped by trace. Searches send the camelCase and snake_case parameter names so that older 2.x releases keep working, and a search without a match is an empty result instead of an error. The default proxy endpoints of the datasource editor now allow the v3 paths. Closes #4560 in perses/perses. Signed-off-by: Ankit Garg <anki88520@gmail.com>
… with the former allowed endpoints Signed-off-by: Ankit Garg <anki88520@gmail.com>
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.
Description
Closes perses/perses#4560
The Jaeger datasource and trace query plugins call Jaeger's v1 query endpoints (
/api/services,/api/operations,/api/traces,/api/traces/{id}). Jaeger removed them in 2.21. I ran the officialjaegertracing/jaegerimages and called the endpoints directly:/api/services/api/v3/servicesSo against 2.21+ listing services and operations, searching traces and loading a trace all fail.
What changed
/api/v3/services,/api/v3/operations,/api/v3/traces,/api/v3/traces/{id}).jaegerTraceToOTLP) and the v1 types are removed. Jaeger writes OTLP enums as numbers (kind: 2), so they are mapped to the names Perses uses (SPAN_KIND_SERVER,STATUS_CODE_ERROR, ...).query.num_tracesfor the search depth, because a release ignores the names it does not know. Tags and span kind are sent asquery.attributes(string values only).No traces found. That is now an empty result, any other failure is reported with Jaeger's message.Compatibility and migration
getTraceData) against real Jaeger servers 2.10, 2.15, 2.16, 2.18, 2.20, 2.21 and 2.22: services, operations, search with operation/tags/duration filters, the result limit, and loading a trace by id all work on every one of them./api/traces,/api/services,/api/operations) has its API v3 requests rejected by the proxy with a 403. In that case the client falls back to the API v1 for that datasource (and remembers it), converting the v1 traces to OTLP, so nothing changes for Jaeger 2.20 and older. The v1 code lives inlegacy-api.tsand can be removed once the old endpoints are no longer worth supporting.GET /api/v3/traces,GET /api/v3/servicesandGET /api/v3/operationsto the allowed endpoints (also in the README). I did not find a way to migrate saved datasources automatically. New datasources get the v3 paths by default.[BUGFIX]since the plugin could not talk to current Jaeger releases at all, but please say if you would rather call it aBREAKINGCHANGE.Screenshots
No visual change.
Checklist
[<catalog_entry>] <commit message>naming convention using one of thefollowing
catalog_entryvalues:FEATURE,ENHANCEMENT,BUGFIX,BREAKINGCHANGE,DOC,IGNORE.UI Changes
See e2e docs for more details. Common issues include:
Testing
In
jaeger/:npm run type-check,npm run test(33 tests, the client andgetTraceDatatests are rewritten around the v3 responses, including a case with spans of several traces and services in one response, and the fallback for datasources with the old allowed endpoints) andoxlint(no new warnings) pass, andoxfmt --checkis clean.Not run: the repo-wide
npm run lint/test,make checklicense,make checkdocs(needs Go and mdox, which I did not set up; no new files and no schema or Go SDK changes), and the Playwright e2e tests (I did not see any covering this plugin).The fallback was also run against real Jaeger 2.20 (with a trace sent over OTLP) and 2.22 behind a fetch that answers 403 for
/api/v3/*, like a proxy with the old allowed endpoints: on 2.20 services, operations, search and get-trace return correct OTLP (parent ids, kinds, status); on 2.22 the error message above is reported.