[8.10] [Telemetry] Fetch snapshot: allow specifying the version via querystring (#164670) (#164684)

# Backport

This will backport the following commits from `main` to `8.10`:
- [[Telemetry] Fetch snapshot: allow specifying the version via
querystring (#164670)](https://github.com/elastic/kibana/pull/164670)

<!--- Backport version: 8.9.7 -->

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

<!--BACKPORT [{"author":{"name":"Alejandro Fernández
Haro","email":"alejandro.haro@elastic.co"},"sourceCommit":{"committedDate":"2023-08-24T10:13:38Z","message":"[Telemetry]
Fetch snapshot: allow specifying the version via querystring
(#164670)","sha":"57a58240d3c784d5bd9fac835f59cce39b923a6d","branchLabelMapping":{"^v8.11.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Core","technical
debt","release_note:skip","backport:prev-minor","v8.11.0"],"number":164670,"url":"https://github.com/elastic/kibana/pull/164670","mergeCommit":{"message":"[Telemetry]
Fetch snapshot: allow specifying the version via querystring
(#164670)","sha":"57a58240d3c784d5bd9fac835f59cce39b923a6d"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.11.0","labelRegex":"^v8.11.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/164670","number":164670,"mergeCommit":{"message":"[Telemetry]
Fetch snapshot: allow specifying the version via querystring
(#164670)","sha":"57a58240d3c784d5bd9fac835f59cce39b923a6d"}}]}]
BACKPORT-->

Co-authored-by: Alejandro Fernández Haro <alejandro.haro@elastic.co>
This commit is contained in:
Kibana Machine 2023-08-24 07:35:29 -04:00 committed by GitHub
parent 9f91b8dd8a
commit bc592cf72a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -92,6 +92,7 @@ export function registerTelemetryUsageStatsRoutes(
.post({
access: 'internal',
path: FetchSnapshotTelemetry,
enableQueryVersion: true, // Allow specifying the version through querystring so that we can use it in Dev Console
})
// Just because it used to be /v2/, we are creating identical v1 and v2.
.addVersion({ version: '1', validate: v2Validations }, v2Handler)