kibana/x-pack/plugins/infra/server/lib
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
..
adapters [Infra IU] Disable Metrics Explorer for serverless (#167022) 2023-09-29 11:27:19 +02:00
alerting [Infra IU] Disable Metrics Explorer for serverless (#167022) 2023-09-29 11:27:19 +02:00
domains [Logs Shared] Move LogStream and LogView into new shared plugin (#161151) 2023-07-05 10:30:28 +02:00
host_details [Logs UI] Set explicit format for all range clauses (#115912) 2021-11-19 09:59:51 +01:00
infra_ml Cleanup spread operators in reduce calls (#157471) 2023-05-22 04:50:24 -07:00
log_analysis [Logs Shared] Move LogStream and LogView into new shared plugin (#161151) 2023-07-05 10:30:28 +02:00
metrics [Metrics] metrics_data_access plugin (#164094) 2023-09-14 12:55:13 +02:00
sources [Infra IU] Disable Metrics Explorer for serverless (#167022) 2023-09-29 11:27:19 +02:00
constants.ts
create_custom_metrics_aggregations.ts [AO] Fix custom equations to support repeating the same variable (#166482) 2023-09-20 10:02:02 +02:00
create_search_client.ts [DX] Upgrade prettier to v2.4.0 (#112359) 2021-09-19 22:34:30 -07:00
infra_types.ts [Metrics] metrics_data_access plugin (#164094) 2023-09-14 12:55:13 +02:00
source_status.ts Change ContextContainer to lazily initialize providers (#129896) 2022-04-22 13:15:58 +02:00