-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[ResponseOps][Actions] Add mustache variable to link back to the rule that created the alert #145132
Comments
Pinging @elastic/response-ops (Team:ResponseOps) |
This PR adds a new actions variable for linking back the stack management rule page. In a future PR we will require the rule type to specify the plugin's path when registering the rule type that way we can link back to the specific plugin that created the rule. Issue: #145132 <details><summary>Mustache variable</summary> ![image](https://user-images.githubusercontent.com/56361221/201212197-48577715-954b-463d-9164-5d2ebfc18cb4.png) ![image](https://user-images.githubusercontent.com/56361221/201212231-23319658-0b21-469b-a272-7c59f5caa618.png) </details> <details><summary>Constructed URL</summary> ![image](https://user-images.githubusercontent.com/56361221/201212322-6a4eab78-88ef-4cef-aa41-e34792a8148b.png) </details> Co-authored-by: Xavier Mouligneau <[email protected]>
We plan on putting this into our backlog but we would be more than happy to help and review a PR to add this capability. Even better if it can re-use or enhance the existing viewInApp URL. |
Wondering if this would be the same as the viewInApp URL that is currently defined by some rule types in the client. Also we should consider what to do for some rule types (like search source query) that already define a backlink context variable but under a different variable name. |
I took a look into the UI usage (code behind "view in app" button using registerNavigation API). There is only one rule type using this feature ( |
…148671) Resolves: #145132. In this PR, I'm adding a new function to the server-side rule type definition called `viewInAppRelativeUrl`. This function returns a relative path to view the rule in the proper application that will provide more context. This relative path is used to build the `rule.url` mustache variable for the actions (overriding the rule details page link when defined) as well as a fallback for the UI's `View in App` button if no navigation is registered on the front-end. Follow up issues: - #149608 - #151355 ## ML to verify 1. Create an anomaly detection rule from the ML application 2. Go to stack management rule details page 3. Click "View in App" 4. Ensure it brings you to the ML app properly. 5. Repeat step 1 to 4 in a space that isn't the default Note: ML won't take advantage of the new functionality yet, but we plan to help in a follow up #149608 so that ML anomaly detection rules can provide a view in app URL within the rule action messages. ## ResponseOps to verify 1. Set `server.publicBaseUrl` to the proper value in your kibana.yml 6. Modify the [index threshold rule type](https://github.com/elastic/kibana/blob/main/x-pack/plugins/stack_alerts/server/rule_types/index_threshold/rule_type.ts#L108-L136) to have a `getViewInAppRelativeUrl` function returning `/app/management/insightsAndAlerting/triggersActionsConnectors/connectors`. 7. Create an index threshold rule that always fires. Make sure to add a a server log action that contains the `{{rule.url}}` variable. 8. Pull the printed URL from the server logs and make sure it works and brings you to the connectors page. 9. Navigate to the rule details page, click the "View in App" button and ensure it also brings you to the connectors page. 10. Create a Kibana space. 11. Go into that created space and repeat step 3 to 5. Ensure the URL and View in App keep you in the same space. --------- Co-authored-by: Kibana Machine <[email protected]>
Add a new mustache variable that injects the url to the rule that generated the alert. Ideally this would link back to the solution who registered the rule type. As a first phase we will link back to the stack management page for all rule types. In the future we can require that the solutions specify their plugin's URL path when registering a rule type. We can switch out the functionality of the mustache variable without a migration once latter solution is implemented.
The text was updated successfully, but these errors were encountered: