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] Explicitly reference a LogsViewConfiguration in log threshold rule parameters #120928

Closed
Tracked by #120920
weltenwort opened this issue Dec 9, 2021 · 1 comment · Fixed by #148897
Closed
Tracked by #120920
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

weltenwort commented Dec 9, 2021

📓 Summary

With the introduction of log views in #120924 the currently implicit dependency of rules on the log view default becomes problematic. In order to prepare for a multiple-log-views scenario we should introduce an explicit reference to the log view's saved object into the rule configuration.

part of #120920

✔️ Acceptance criteria

  • The log threshold rule has a parameter that determines the log view to use for this rule.
  • The log view reference is handled as a proper saved object reference so it supports Kibana's referential integrity mechanisms.
  • If the rule is created from within the Logs UI, the reference is initialized to the current log view.
  • If the rule is not created from within the Logs UI, the reference is initialized to the default log view.
  • The references log view's name is displayed in the rule parameters.
  • If the reference is broken, display a warning and prevent saving of the rule.

💡 Background

Alternatives considered

Copy the params (i.e. index name, timestamp field) by value

  • might make the rules more robust
  • behaves like ml jobs (with all the problems that brings)
  • but linking back to the log stream would be difficult

Add reference but also copy the params

  • allow for efficient detection of "the log view has changed"
  • would require UX to communicate that to the user and reconcile divergence

⏩ Follow-up tasks

  • Allow for the user to choose the associated log view
  • Allow for cloning of the log view at rule creation time
@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 needs-refinement A reason and acceptance criteria need to be defined for this issue labels Dec 9, 2021
@elasticmachine
Copy link
Contributor

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

@weltenwort weltenwort removed the needs-refinement A reason and acceptance criteria need to be defined for this issue label May 16, 2022
@tonyghiani tonyghiani self-assigned this Jan 12, 2023
tonyghiani added a commit that referenced this issue Jan 31, 2023
#148897)

## 📓 Summary

Closes #120928 

These changes allow passing to the log threshold rule executor the
logViewId as a parameter, enabling the user to select what LogView the
alert should be associated with.
It also includes displaying the current LogView name in the rule
parameters and the log view reference is handled as a saved object
reference.

**_Disclaimer_**:
The `LogViewSwitcher` component will allow, with another implementation,
to switch between the available logViews with the support of the
multi-logView concept.
It currently renders a read-only expression to tell the user to which
logView is the new alert associated.

## 🧪 Testing

Navigate to Log UI, click on _Alerts and rules_ on the top-right menu,
then _Create rule_, you should see the current log view name in the
default expression. It is currently only a label, it'll be a dropdown
selector in future.

<img width="1502" alt="after"
src="https://user-images.githubusercontent.com/34506779/212651986-8c1b4a1d-356d-4966-aa30-f1af3171be72.png">

---------

Co-authored-by: Marco Antonio Ghiani <[email protected]>
Co-authored-by: kibanamachine <[email protected]>
kqualters-elastic pushed a commit to kqualters-elastic/kibana that referenced this issue Feb 6, 2023
elastic#148897)

## 📓 Summary

Closes elastic#120928 

These changes allow passing to the log threshold rule executor the
logViewId as a parameter, enabling the user to select what LogView the
alert should be associated with.
It also includes displaying the current LogView name in the rule
parameters and the log view reference is handled as a saved object
reference.

**_Disclaimer_**:
The `LogViewSwitcher` component will allow, with another implementation,
to switch between the available logViews with the support of the
multi-logView concept.
It currently renders a read-only expression to tell the user to which
logView is the new alert associated.

## 🧪 Testing

Navigate to Log UI, click on _Alerts and rules_ on the top-right menu,
then _Create rule_, you should see the current log view name in the
default expression. It is currently only a label, it'll be a dropdown
selector in future.

<img width="1502" alt="after"
src="https://user-images.githubusercontent.com/34506779/212651986-8c1b4a1d-356d-4966-aa30-f1af3171be72.png">

---------

Co-authored-by: Marco Antonio Ghiani <[email protected]>
Co-authored-by: kibanamachine <[email protected]>
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