mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
Use alert details page URL for the log threshold rule if the config is enabled (#161175)
Fixes #161117
## Summary
If `xpack.observability.unsafe.alertDetails.logs.enabled` is enabled, we
will use the new alert details page URL in `context.alertDetailsUrl`
otherwise, we send the user to the alerts page filtered for that alert.
(Partially brings back [the logic for alert details
URL](https://github.com/elastic/kibana/pull/157987/files#diff-a71ca536380c1fde8805744b23566ce795707f92b94a03af73347cac46ccac63L1027)
and
[getAlertDetailsConfig](https://github.com/elastic/kibana/pull/157987/files#diff-a71ca536380c1fde8805744b23566ce795707f92b94a03af73347cac46ccac63L1027))
## 🧪 How to test
1. Set `xpack.observability.unsafe.alertDetails.logs.enabled` as false
in Kibana yml config or remove the config
2. Create a log threshold rule with an action for both active state and
recovered state
3. When the alert is triggered, check the default message, it should
include the alertDetailsURL, by clicking on that, you should land on the
alerts page filtered for that alert
4. Make the alert recovered and check and similar URL should be
generated
New alert details page:
1. Set `xpack.observability.unsafe.alertDetails.logs.enabled` as true in
Kibana yml config
2. Repeat the steps 2,3,4 as mentioned before
3. This time, you should land on the new alert details page

This commit is contained in:
parent
ee6ca657ee
commit
f758ba4750
4 changed files with 41 additions and 15 deletions
|
@ -193,6 +193,7 @@ export class InfraServerPlugin
|
|||
logsRules: this.logsRules.setup(core, plugins),
|
||||
metricsRules: this.metricsRules.setup(core, plugins),
|
||||
getStartServices: () => core.getStartServices(),
|
||||
getAlertDetailsConfig: () => plugins.observability.getAlertDetailsConfig(),
|
||||
logger: this.logger,
|
||||
basePath: core.http.basePath,
|
||||
alertsLocator: plugins.share.url.locators.get(alertsLocatorID),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue