Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
crespocarlos opened this issue Apr 12, 2024 · 3 comments · Fixed by #189541
Closed

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

crespocarlos opened this issue Apr 12, 2024 · 3 comments · Fixed by #189541
Assignees
Labels
Feature:Metrics UI Metrics UI feature Feature:ObsHosts Hosts feature within Observability Feature:ObsInventory good first issue low hanging fruit Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team

Comments

@crespocarlos
Copy link
Contributor

crespocarlos commented Apr 12, 2024

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

  • GET /api/metrics/source/{sourceId} doesn't return the indexFields object in the status attribute
  • All infra pages work as expected
@botelastic botelastic bot added the needs-team Issues missing a team label label Apr 12, 2024
@crespocarlos crespocarlos added the Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team label Apr 12, 2024
@elasticmachine
Copy link
Contributor

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

@botelastic botelastic bot removed the needs-team Issues missing a team label label Apr 12, 2024
@crespocarlos crespocarlos added Feature:Metrics UI Metrics UI feature Feature:ObsHosts Hosts feature within Observability Feature:ObsInventory labels Apr 12, 2024
@neptunian
Copy link
Contributor

neptunian commented Apr 29, 2024

Related: In #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 #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.

@crespocarlos crespocarlos added needs-refinement A reason and acceptance criteria need to be defined for this issue good first issue low hanging fruit and removed needs-refinement A reason and acceptance criteria need to be defined for this issue labels Jul 22, 2024
@crespocarlos crespocarlos changed the title [Infra] Improve /api/metrics/source endpoint [Infra] Remove indexFields from /api/metrics/source endpoint Jul 26, 2024
@jennypavlova jennypavlova self-assigned this Jul 29, 2024
@jennypavlova
Copy link
Member

Closed by #189541

jennypavlova added a commit that referenced this issue Aug 1, 2024
Relates to #180690

## Summary

This PR is a follow-up to #189541
and removes additional functions related to the `indexFields` that are
no longer needed

## Testing

Check `metricIndicesExist` and `remoteClustersExist` in the request by
changing the settings (in the first video I use metricbeat and no oblt
cluster and in the second one I am connected to oblt cluster)



https://github.com/user-attachments/assets/59920479-5a42-4a6a-a66a-307ddfc48fd8



https://github.com/user-attachments/assets/ef04120c-6873-4b0c-813c-388147c2b741
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Metrics UI Metrics UI feature Feature:ObsHosts Hosts feature within Observability Feature:ObsInventory good first issue low hanging fruit Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants