[8.17] [Monitoring] Make monitoring collection API public again (#205190) (#205199)

# Backport

This will backport the following commits from `main` to `8.17`:
- [[Monitoring] Make monitoring collection API public again
(#205190)](https://github.com/elastic/kibana/pull/205190)

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

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

<!--BACKPORT [{"author":{"name":"Valentin
Crettaz","email":"valentin.crettaz@elastic.co"},"sourceCommit":{"committedDate":"2024-12-27T12:16:01Z","message":"[Monitoring]
Make monitoring collection API public again (#205190)\n\nRelated to
https://github.com/elastic/kibana/pull/186882\r\n\r\n##
Summary\r\n\r\nhttps://github.com/elastic/kibana/issues/186781 required
all teams to\r\nmake sure that all Kibana APIs in their respective
plugins were using\r\nthe appropriate access `internal` or
`public`.\r\n\r\nPR https://github.com/elastic/kibana/pull/186882
flagged the\r\n`/api/monitoring_collection/{type}` API endpoint as
`internal`. The\r\neffect of that change was the [appearance of
deprecation\r\nlogging](https://github.com/elastic/kibana/pull/186882#issuecomment-2431021055)\r\nin
Kibana logs, because that endpoint is called from the
[`kibana`\r\nMetricbeat\r\nmodule](https://github.com/elastic/beats/blob/main/metricbeat/module/kibana/kibana.go#L42C1-L46C1)\r\nin
order to monitor Kibana.\r\n\r\nFor this reason, we need to change the
access mode of that API endpoint\r\nback to
`public`.","sha":"52cab456fd5e54268f5d42dd1677f755a2e42b4d","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["backport","Team:Monitoring","release_note:skip","v9.0.0","backport:prev-major","v8.18.0","v8.16.3","backport:8.17"],"title":"[Monitoring]
Make monitoring collection API public
again","number":205190,"url":"https://github.com/elastic/kibana/pull/205190","mergeCommit":{"message":"[Monitoring]
Make monitoring collection API public again (#205190)\n\nRelated to
https://github.com/elastic/kibana/pull/186882\r\n\r\n##
Summary\r\n\r\nhttps://github.com/elastic/kibana/issues/186781 required
all teams to\r\nmake sure that all Kibana APIs in their respective
plugins were using\r\nthe appropriate access `internal` or
`public`.\r\n\r\nPR https://github.com/elastic/kibana/pull/186882
flagged the\r\n`/api/monitoring_collection/{type}` API endpoint as
`internal`. The\r\neffect of that change was the [appearance of
deprecation\r\nlogging](https://github.com/elastic/kibana/pull/186882#issuecomment-2431021055)\r\nin
Kibana logs, because that endpoint is called from the
[`kibana`\r\nMetricbeat\r\nmodule](https://github.com/elastic/beats/blob/main/metricbeat/module/kibana/kibana.go#L42C1-L46C1)\r\nin
order to monitor Kibana.\r\n\r\nFor this reason, we need to change the
access mode of that API endpoint\r\nback to
`public`.","sha":"52cab456fd5e54268f5d42dd1677f755a2e42b4d"}},"sourceBranch":"main","suggestedTargetBranches":["8.x","8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/205190","number":205190,"mergeCommit":{"message":"[Monitoring]
Make monitoring collection API public again (#205190)\n\nRelated to
https://github.com/elastic/kibana/pull/186882\r\n\r\n##
Summary\r\n\r\nhttps://github.com/elastic/kibana/issues/186781 required
all teams to\r\nmake sure that all Kibana APIs in their respective
plugins were using\r\nthe appropriate access `internal` or
`public`.\r\n\r\nPR https://github.com/elastic/kibana/pull/186882
flagged the\r\n`/api/monitoring_collection/{type}` API endpoint as
`internal`. The\r\neffect of that change was the [appearance of
deprecation\r\nlogging](https://github.com/elastic/kibana/pull/186882#issuecomment-2431021055)\r\nin
Kibana logs, because that endpoint is called from the
[`kibana`\r\nMetricbeat\r\nmodule](https://github.com/elastic/beats/blob/main/metricbeat/module/kibana/kibana.go#L42C1-L46C1)\r\nin
order to monitor Kibana.\r\n\r\nFor this reason, we need to change the
access mode of that API endpoint\r\nback to
`public`.","sha":"52cab456fd5e54268f5d42dd1677f755a2e42b4d"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.16","label":"v8.16.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Valentin Crettaz <valentin.crettaz@elastic.co>
This commit is contained in:
Kibana Machine 2024-12-28 01:02:09 +11:00 committed by GitHub
parent 9864cfcf70
commit 78f7db80c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -37,7 +37,7 @@ export function registerDynamicRoute({
{
path: `${MONITORING_COLLECTION_BASE_PATH}/{type}`,
options: {
access: 'internal',
access: 'public',
authRequired: true,
tags: ['api'], // ensures that unauthenticated calls receive a 401 rather than a 302 redirect to login page
},