elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.69k stars 8.12k forks source link

[Infra] Remove `indexFields` from `/api/metrics/source` endpoint #180690

Closed crespocarlos closed 1 month ago

crespocarlos commented 4 months ago

Summary

Infra uses /api/metrics/source/{sourceId} endpoint to register, update, and retrieve the Infra Settings. However, it also returns a representation of a data view, built from the Metrics Indices config. This object can be very large depending on the number of indices that are part of the index pattern configured.

We're no longer using the fields returned by this endpoint in the "status" object, therefore the indexFields can be removed from the response as well as any code related to its retrieval

e.g: response

{
  "source": {
    "id": "default",
    "version": "WzM0LDFd",
    "updatedAt": 1712829507652,
    "origin": "stored",
    "configuration": {
        "name": "Default",
        "description": "",
        "metricAlias": "remote_cluster:metrics-*,remote_cluster:metricbeat-*",
        "inventoryDefaultView": "0",
        "metricsExplorerDefaultView": "0",
        "anomalyThreshold": 50
    },
    "status": {
        "metricIndicesExist": true
        "remoteClusterExist": true
    }
}

Related to #180689

AC

elasticmachine commented 4 months ago

Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services)

neptunian commented 4 months ago

Related: In https://github.com/elastic/kibana/pull/164094, we created a way to access the metrics indices without having to use this endpoint (/api/metrics/source/) by creating the metrics data access plugin and storing the indices value in metrics-data-source saved object. The indices are meant to stop being set in infrastructure-ui-source saved object as part of https://github.com/elastic/kibana/issues/168282. You can already get just the indices value by using client in the plugin https://github.com/elastic/kibana/tree/main/x-pack/plugins/metrics_data_access.

jennypavlova commented 1 month ago

Closed by https://github.com/elastic/kibana/pull/189541