kibana/x-pack/test/api_integration/apis/metrics_ui
Carlos Crespo d79a38363a
[Infra UI] Cleanup host-specific Node Detail Page code (#166828)
closes: https://github.com/elastic/kibana/issues/166428

## Summary

This PR removes code that is no longer needed after replacing the Node
Details View for Host with the Asset Details.

### TSVB

The TSVB files were apparently only used to display charts in the Node
Details view. Due to the Asset Details using Lens to power the charts,
corresponding `host` TSVB formulas and configs are no longer needed.

Therefore, `host*`, `hostK8s*`, and `hostDocker*` (the latter appears to
have never been used) have been removed. Additionally, `aws*` from
`required_metrics` was also removed because it was host-specific.

### FE Components

The main change is in the `useMetadata` hook. I have changed the hook
signature, making `requiredMetrics` optional. This parameter is used to
process additional filtering and is only used in asset types that the
old Node Details page supports. Not passing it is not expected to break
other places that depend on this hook.

### Server

Removing TSVB files has a direct impact on the
`api/metrics/node_details` endpoint. This endpoint is only used to
provide data to the Node Details page. It returns a 400 error if an
invalid metric is passed - which will be the case for hosts

**Example Request:**
```json
POST kbn:api/metrics/node_details
{
  "metrics": [
    "hostK8sCpuCap",
    "hostSystemOverview"
  ],
  "nodeId": "gke-release-oblt-release-oblt-pool-c4163099-bcaj",
  "nodeType": "host",
  "timerange": {
    "from": 1695210522045,
    "to": 1695214122045,
    "interval": ">=1m"
  },
  "cloudId": "6106013995483209805",
  "sourceId": "default"
}
```

**Response:**
```json
{
  "statusCode": 400,
  "error": "Bad Request",
  "message": "Failed to validate: \n  in metrics/0: \"hostK8sCpuCap\" does not match expected type \"podOverview\" | \"podCpuUsage\" | \"podMemoryUsage\" | \"podLogUsage\" | \"podNetworkTraffic\" | \"containerOverview\" | \"containerCpuKernel\" | \"containerCpuUsage\" | \"containerDiskIOOps\" | \"containerDiskIOBytes\" | \"containerMemory\" | \"containerNetworkTraffic\" | \"containerK8sOverview\" | \"containerK8sCpuUsage\" | \"containerK8sMemoryUsage\" | \"nginxHits\" | \"nginxRequestRate\" | \"nginxActiveConnections\" | \"nginxRequestsPerConnection\" | \"awsEC2CpuUtilization\" | \"awsEC2NetworkTraffic\" | \"awsEC2DiskIOBytes\" | \"awsS3TotalRequests\" | \"awsS3NumberOfObjects\" | \"awsS3BucketSize\" | \"awsS3DownloadBytes\" | \"awsS3UploadBytes\" | \"awsRDSCpuTotal\" | \"awsRDSConnections\" | \"awsRDSQueriesExecuted\" | \"awsRDSActiveTransactions\" | \"awsRDSLatency\" | \"awsSQSMessagesVisible\" | \"awsSQSMessagesDelayed\" | \"awsSQSMessagesSent\" | \"awsSQSMessagesEmpty\" | \"awsSQSOldestMessage\" | \"custom\"\n  in metrics/1: \"hostSystemOverview\" does not match expected type \"podOverview\" | \"podCpuUsage\" | \"podMemoryUsage\" | \"podLogUsage\" | \"podNetworkTraffic\" | \"containerOverview\" | \"containerCpuKernel\" | \"containerCpuUsage\" | \"containerDiskIOOps\" | \"containerDiskIOBytes\" | \"containerMemory\" | \"containerNetworkTraffic\" | \"containerK8sOverview\" | \"containerK8sCpuUsage\" | \"containerK8sMemoryUsage\" | \"nginxHits\" | \"nginxRequestRate\" | \"nginxActiveConnections\" | \"nginxRequestsPerConnection\" | \"awsEC2CpuUtilization\" | \"awsEC2NetworkTraffic\" | \"awsEC2DiskIOBytes\" | \"awsS3TotalRequests\" | \"awsS3NumberOfObjects\" | \"awsS3BucketSize\" | \"awsS3DownloadBytes\" | \"awsS3UploadBytes\" | \"awsRDSCpuTotal\" | \"awsRDSConnections\" | \"awsRDSQueriesExecuted\" | \"awsRDSActiveTransactions\" | \"awsRDSLatency\" | \"awsSQSMessagesVisible\" | \"awsSQSMessagesDelayed\" | \"awsSQSMessagesSent\" | \"awsSQSMessagesEmpty\" | \"awsSQSOldestMessage\" | \"custom\""
}
```

### How to Test
- Start a local Kibana instance pointing to an oblt cluster.
- Navigate to `Infrastructure`.
- Try different asset types and navigate to the Node Details view.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-09-28 12:39:04 +02:00
..
config.ts [ftr] split x-pack api integration tests based on plugin (#150837) 2023-02-13 15:06:11 +00:00
constants.ts Fixes issue in sorting using TX and RX columns (#145994) 2022-11-29 10:41:18 +01:00
create_fake_logger.ts Implement Logger.isLevelEnabled (#144033) 2022-10-28 00:31:32 -07:00
http_source.ts fix all violations 2022-04-16 01:37:30 -05:00
index.js [AO] Add alertDetailsUrl for infra rule (#157987) 2023-05-26 10:14:05 +02:00
infra.ts [Infrastructure UI] Reorganize metric charts in the hosts view (#159457) 2023-06-15 14:33:31 +02:00
infra_log_analysis_validation_log_entry_datasets.ts [Logs UI] Versioning for Logs related APIs (#158710) 2023-06-08 15:43:46 +02:00
inventory_threshold_alert.ts Adds list of containers in context variable of Inventory rule (#144526) 2022-11-10 19:24:03 +01:00
ip_to_hostname.ts [esArchiver] drop support for --dir, use repo-relative paths instead (#101345) 2021-06-08 17:37:42 -04:00
log_entry_highlights.ts [Logs UI] Adapt test to ES highlighting changes and unskip (#163592) 2023-08-10 15:39:58 +02:00
log_summary.ts [Logs Shared] Move LogStream and LogView into new shared plugin (#161151) 2023-07-05 10:30:28 +02:00
metadata.ts [Infra UI] Add tooltips to Asset Details (#164858) 2023-08-30 11:26:42 -07:00
metric_threshold_alert.ts [AO] Fix custom equations to support repeating the same variable (#166482) 2023-09-20 10:02:02 +02:00
metrics.ts [Infra UI] Cleanup host-specific Node Detail Page code (#166828) 2023-09-28 12:39:04 +02:00
metrics_alerting.ts [Infrastructure UI][Rules] Refactor Metric Threshold rule to push evaluations to Elasticsearch (#126214) 2022-05-17 08:11:32 -06:00
metrics_explorer.ts [AO] Fix custom equations to support repeating the same variable (#166482) 2023-09-20 10:02:02 +02:00
metrics_overview_top.ts Fixes issue in sorting using TX and RX columns (#145994) 2022-11-29 10:41:18 +01:00
metrics_process_list.ts fix all violations 2022-04-16 01:37:30 -05:00
metrics_process_list_chart.ts fix all violations 2022-04-16 01:37:30 -05:00
snapshot.ts [Infrastructure UI] Filter out null bucket items from average calculation (#152333) 2023-03-01 15:31:35 +01:00
sources.ts [Archive Migration] batch 2 of removing es_archives/empty_kibana (#138208) 2022-08-23 12:31:39 -07:00