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] Create a data view client #180689

Open
crespocarlos opened this issue Apr 12, 2024 · 1 comment · May be fixed by #181954
Open

[Infra] Create a data view client #180689

crespocarlos opened this issue Apr 12, 2024 · 1 comment · May be fixed by #181954
Assignees
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 technical debt Improvement of the software architecture and operational architecture

Comments

@crespocarlos
Copy link
Contributor

crespocarlos commented Apr 12, 2024

Summary

Inventory and Metrics UIs use GET /api/metrics/source/{sourceId} (via context) to retrieve the metric indices fields list, which is later used to render their corresponding search bars.

The Hosts View doesn't need the fields list returned by GET /api/metrics/source/{sourceId} , yet it calls it to retrieve the metricAlias (via context), which is later used to create an ad-hoc data-view (which also retrieves a list of fields)

One problem with having GET /api/metrics/source/{sourceId} returning the fields list is that it increases the response size, and this endpoint should be only responsible for returning the Infra settings, not indices fields details, another problem is that code is old and it has a rather convoluted way to retrieve the fields list (see also the adapter code), making maintenance more challenging.

Solution

Similar to Logs UI, and because ad-hoc data view also contains the fields list, the idea is to create a client responsible for creating an ad-hoc data view from the metricsAlias returned by GET /api/metrics/source/{sourceId}.

The client will replace the manual retrieval of the fields list used in the GET /api/metrics/source/{sourceId} and deprecate the use_data_view hook used in the hosts view, and will be used in the frontend.

@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
@crespocarlos crespocarlos self-assigned this Apr 25, 2024
@smith smith added the technical debt Improvement of the software architecture and operational architecture label Apr 30, 2024
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 technical debt Improvement of the software architecture and operational architecture
Projects
None yet
3 participants