From 52cab456fd5e54268f5d42dd1677f755a2e42b4d Mon Sep 17 00:00:00 2001 From: Valentin Crettaz Date: Fri, 27 Dec 2024 13:16:01 +0100 Subject: [PATCH] [Monitoring] Make monitoring collection API public again (#205190) Related to https://github.com/elastic/kibana/pull/186882 ## Summary https://github.com/elastic/kibana/issues/186781 required all teams to make sure that all Kibana APIs in their respective plugins were using the appropriate access `internal` or `public`. PR https://github.com/elastic/kibana/pull/186882 flagged the `/api/monitoring_collection/{type}` API endpoint as `internal`. The effect of that change was the [appearance of deprecation logging](https://github.com/elastic/kibana/pull/186882#issuecomment-2431021055) in Kibana logs, because that endpoint is called from the [`kibana` Metricbeat module](https://github.com/elastic/beats/blob/main/metricbeat/module/kibana/kibana.go#L42C1-L46C1) in order to monitor Kibana. For this reason, we need to change the access mode of that API endpoint back to `public`. --- .../server/routes/api/v1/dynamic_route/get_metrics_by_type.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/platform/plugins/private/monitoring_collection/server/routes/api/v1/dynamic_route/get_metrics_by_type.ts b/x-pack/platform/plugins/private/monitoring_collection/server/routes/api/v1/dynamic_route/get_metrics_by_type.ts index a128d14314052..d8e26c4f6f971 100644 --- a/x-pack/platform/plugins/private/monitoring_collection/server/routes/api/v1/dynamic_route/get_metrics_by_type.ts +++ b/x-pack/platform/plugins/private/monitoring_collection/server/routes/api/v1/dynamic_route/get_metrics_by_type.ts @@ -44,7 +44,7 @@ export function registerDynamicRoute({ }, }, options: { - access: 'internal', + access: 'public', authRequired: true, tags: ['api'], // ensures that unauthenticated calls receive a 401 rather than a 302 redirect to login page },