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

[Logs UI] Support inline log views in http routes #151489

Closed
Tracked by #134412
weltenwort opened this issue Feb 16, 2023 · 1 comment · Fixed by #151760
Closed
Tracked by #134412

[Logs UI] Support inline log views in http routes #151489

weltenwort opened this issue Feb 16, 2023 · 1 comment · Fixed by #151760
Assignees
Labels
Feature:Logs UI Logs UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services

Comments

@weltenwort
Copy link
Member

📓 Summary

Currently the HTTP routes used by the browser to fetch log data require a sourceId parameter which is used to look up the LogView for the request. In order to allow for querying log data based on inline log views, the HTTP routes must be able to also accept full log view definitions as a parameter so step of loading it from a saved object can be skipped.

✔️ Acceptance criteria

  • All log-related HTTP routes in the infra plugin (except for the log view routes themselves), that take a sourceId parameter instead take a logView parameter as described below.
  • The logView parameter can contain either...
    • a log view reference by id as already defined in
      export const logViewReferenceRT = rt.type({
      logViewId: rt.string,
      type: rt.literal('log-view-reference'),
      });
      export type LogViewReference = rt.TypeOf<typeof logViewReferenceRT>;
      or
    • an inline log view like { type: 'inline-log-view', id: string, attributes: logViewAttributesRT }
  • The routes handle requests referring to a log-view-reference like before with the sourceId by loading and resolving the log view.
  • The routes handle requests referring to an inline-log-view by resolving the given attributes with LogViewClient.resolveLogView() directly.

💡 Implementation hints

  • The log-view-reference type is already defined in
    export const logViewReferenceRT = rt.type({
    logViewId: rt.string,
    type: rt.literal('log-view-reference'),
    });
    export type LogViewReference = rt.TypeOf<typeof logViewReferenceRT>;
    . It just needs to be wrapped in a union together with the new inline-log-view type.
@weltenwort weltenwort added Feature:Logs UI Logs UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services labels Feb 16, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/infra-monitoring-ui (Team:Infra Monitoring UI)

@Kerry350 Kerry350 self-assigned this Feb 20, 2023
Kerry350 added a commit that referenced this issue Mar 2, 2023
## Summary

Closes #151489

This is the server side portion of support for transient / inline Log
Views. Alerting and ML based functionality is scoped to the persisted
type only, as we won't be supporting inline Log Views in those contexts.

In terms of UI, changes have been made as close to the edge / boundary
to the server (e.g. where we actually make network requests) as
possible. This is because the bulk of the UI changes will come in
#142840.

## Testing

This is predominantly a type-driven refactoring (the best kind), so we
should be relatively safe here (especially since inline views aren't in
the UI yet). But, a quick test of each page and a high level functional
test would still be good.
bmorelli25 pushed a commit to bmorelli25/kibana that referenced this issue Mar 10, 2023
## Summary

Closes elastic#151489

This is the server side portion of support for transient / inline Log
Views. Alerting and ML based functionality is scoped to the persisted
type only, as we won't be supporting inline Log Views in those contexts.

In terms of UI, changes have been made as close to the edge / boundary
to the server (e.g. where we actually make network requests) as
possible. This is because the bulk of the UI changes will come in
elastic#142840.

## Testing

This is predominantly a type-driven refactoring (the best kind), so we
should be relatively safe here (especially since inline views aren't in
the UI yet). But, a quick test of each page and a high level functional
test would still be good.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Logs UI Logs UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants