[8.17] [Synthtrace] Fix synthtrace to work with 7.x clusters (#209447) (#209479)

# Backport

This will backport the following commits from `main` to `8.17`:
- [[Synthtrace] Fix synthtrace to work with 7.x clusters
(#209447)](https://github.com/elastic/kibana/pull/209447)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Achyut
Jhunjhunwala","email":"achyut.jhunjhunwala@elastic.co"},"sourceCommit":{"committedDate":"2025-02-04T09:25:00Z","message":"[Synthtrace]
Fix synthtrace to work with 7.x clusters (#209447)\n\n##
Summary\r\n\r\nWhile working on 9.x Upgrade testing, i found that when
running\r\nsynthtrace scenarios pointing to a 7.x cluster, it tries to
fetch the\r\nlatest version of the APM package. In 7.x, the
`latestVersion` item was\r\npresent under a different node in the API
response. Hence adding
this\r\nfix.","sha":"032337332c020baeabc215f123eaca833efafdd5","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:prev-minor","backport:prev-major","ci:project-deploy-observability","Team:obs-ux-logs","Team:obs-ux-infra_services","v9.1.0"],"title":"[Synthtrace]
Fix synthtrace to work with 7.x
clusters","number":209447,"url":"https://github.com/elastic/kibana/pull/209447","mergeCommit":{"message":"[Synthtrace]
Fix synthtrace to work with 7.x clusters (#209447)\n\n##
Summary\r\n\r\nWhile working on 9.x Upgrade testing, i found that when
running\r\nsynthtrace scenarios pointing to a 7.x cluster, it tries to
fetch the\r\nlatest version of the APM package. In 7.x, the
`latestVersion` item was\r\npresent under a different node in the API
response. Hence adding
this\r\nfix.","sha":"032337332c020baeabc215f123eaca833efafdd5"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/209447","number":209447,"mergeCommit":{"message":"[Synthtrace]
Fix synthtrace to work with 7.x clusters (#209447)\n\n##
Summary\r\n\r\nWhile working on 9.x Upgrade testing, i found that when
running\r\nsynthtrace scenarios pointing to a 7.x cluster, it tries to
fetch the\r\nlatest version of the APM package. In 7.x, the
`latestVersion` item was\r\npresent under a different node in the API
response. Hence adding
this\r\nfix.","sha":"032337332c020baeabc215f123eaca833efafdd5"}}]}]
BACKPORT-->

Co-authored-by: Achyut Jhunjhunwala <achyut.jhunjhunwala@elastic.co>
This commit is contained in:
Kibana Machine 2025-02-04 22:27:07 +11:00 committed by GitHub
parent 4fa854df99
commit 795ba16657
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -53,6 +53,11 @@ export class ApmSynthtraceKibanaClient {
);
}
// Add support for 7.x stack as latest version is available under different node
if (responseJson.response && responseJson.response.latestVersion) {
return responseJson.response.latestVersion as string;
}
return responseJson.item.latestVersion as string;
};