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] Improve /api/metrics/source endpoint #180690

Open
crespocarlos opened this issue Apr 12, 2024 · 2 comments
Open

[Infra] Improve /api/metrics/source endpoint #180690

crespocarlos opened this issue Apr 12, 2024 · 2 comments
Labels
Feature:Metrics UI Metrics UI feature Feature:ObsHosts Hosts feature within Observability Feature:ObsInventory 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, which is used by the Infra UIs.

The idea is to split that process, following the way Logs UI handles the same idea, making the /source endpoint only responsible for managing the Saved Object that stores the settings config, removing the retrieval of the indices fields

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
    }
  }
}

Probably depends on #180689

AC

  • GET /api/metrics/source/{sourceId} doesn't return status attribute, which contains the indices fields
@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.

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 Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team
Projects
None yet
Development

No branches or pull requests

3 participants