Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Infra UI] Cleanup host-specific Node Detail Page code (#166828)
closes: #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>
- Loading branch information