kibana/x-pack/plugins/infra/public/containers
Mykola Harmash d0a0a1f9e6
[Infra IU] Disable Metrics Explorer for serverless (#167022)
Closes #163282 

## Summary

This PR:
* Adds a `featureFlags.metricsExplorerEnabled` property to the Infra
plugin config to enable and disable Metrics Explorer depending on the
offering type
* Prevents `MetricsExplorerViewsService` initialization for serveless
based on the feature flag
* Prevents creating Metrics Explorer frontend routes when in serverless
* Prevents registration of the MetricsExplorerViews saved object when in
serverless
* Prevents initialization of the `metrics_explorer_views` API routes
when in serverless

**Trying to access Metrics Explorer in serverless**
<img width="1829" alt="CleanShot 2023-09-22 at 12 59 35@2x"
src="2b039925-0f0b-4c07-be29-bbe910de7a34">

**Trying to access views API**
<img width="1829" alt="CleanShot 2023-09-22 at 13 00 00@2x"
src="15269ec2-becd-4ee3-9b5e-d916df28a7b8">

**`infra/metrics_explorer` API still works as per ticket requirements**
<img width="1829" alt="CleanShot 2023-09-22 at 13 00 06@2x"
src="fb23f912-c6fd-46c8-9084-c17c51e5b064">


## How to test
* Checkout locally
* Enable Infra in `serverless.oblt.yml`: `xpack.infra.enabled: true`
* Run Kibana in serverless mode
* Try accessing `/app/metrics/explorer` route and make sure it's not
available
* Make sure other Infra routes (`/app/metrics/inventory` and
`/app/metrics/hosts`) still load as expected
* In Kibana dev console make sure you get 404 for `GET
kbn:/api/infra/metrics_explorer_views`
* Also check that you don't see `metrics-explorer-view` saved object in
the response for `GET
kbn:/api/kibana/management/saved_objects/_allowed_types`
* Run Kibana in non-serverless mode and make sure Metrics Explorer is
accessible and works as usual

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-09-29 11:27:19 +02:00
..
logs [Logs Shared] Move LogStream and LogView into new shared plugin (#161151) 2023-07-05 10:30:28 +02:00
metrics_explorer [Infrastructure UI] Add strict payload validation to metrics_explorer_views endpoint (#160982) 2023-07-14 14:20:03 +02:00
metrics_source [Infrastructure UI] Improve error handling metric index (#152840) 2023-03-23 18:34:09 +01:00
ml [Logs UI] Versioning for Logs related APIs (#158710) 2023-06-08 15:43:46 +02:00
plugin_config_context.test.tsx [Infra IU] Disable Metrics Explorer for serverless (#167022) 2023-09-29 11:27:19 +02:00
plugin_config_context.ts [Infra IU] Disable Metrics Explorer for serverless (#167022) 2023-09-29 11:27:19 +02:00
react_query_provider.tsx Enable "Event Generating Elements Should Be Instrumented" ESLint rule for more O11y Apps (#165647) 2023-09-05 15:48:03 -04:00
with_kuery_autocompletion.tsx [Infra Monitoring UI] fix query suggestions, add and comment in tests (#137908) 2022-08-03 11:48:31 -04:00