Add context.alertDetailsUrl to connector template when configuring a Rule#142854
Conversation
There was a problem hiding this comment.
That is cool, @CoenWarmer. Did you consider Kibana spaces in the URL?
Thanks @fkanout; re: spaces: Not yet, will do! |
benakansara
left a comment
There was a problem hiding this comment.
Should we include full URL in the notification which user can directly click and navigate? e.g. http://localhost:5601/abc/app/observability/alerts/24b3905c-5ae7-49b1-903f-e7510116af39
.../infra/server/lib/alerting/inventory_metric_threshold/inventory_metric_threshold_executor.ts
Outdated
Show resolved
Hide resolved
|
@CoenWarmer If I understood correctly, currently we are adding |
|
@simianhacker We don't know the Alert UUID in the context of the executor function, right? If I understand correctly, an instance of an Alert is created after the executor has run? --Edit: Turns out we do have it. PR updated with new approach. |
53fe49b to
f50f780
Compare
daa7fd4 to
d2a5272
Compare
|
@CoenWarmer What's your thoughts on alerts without UUIDs? Right now the the UUID gets created after the alert is scheduled (and after the alert detail link) is generated for "new" alerts. I wonder if we shouldn't create the UUID when kibana/x-pack/plugins/rule_registry/server/utils/create_lifecycle_executor.ts Lines 229 to 232 in 4feb397 |
|
@simianhacker Lets discuss this today in our 1 on 1. |
|
@CoenWarmer, would please share the outcomes of your meeting with @simianhacker regarding the availability of alert UUID? |
42f44c0 to
ff8ff35
Compare
…in actionVariables array
ae4d760 to
9de24d4
Compare
…-context-alertDetailsUrl-for-given-alert-as-an-action-variable
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
History
To update your PR or re-run it, just comment with: |
ymao1
left a comment
There was a problem hiding this comment.
LGTM. Left one more nit about alertInstanceId. Thanks!
| const alertId = hit._source ? hit._source[ALERT_INSTANCE_ID] : void 0; | ||
| if (alertId && hit._source) { | ||
| trackedAlertsDataMap[alertId] = { | ||
| const alertInstanceId = hit._source ? hit._source[ALERT_INSTANCE_ID] : void 0; |
There was a problem hiding this comment.
nit: can we change this back to alertId as well?
Summary
Adds the
context.alertDetailsUrlvariable when configuring a connector template.Resolves #139923
Resolves #141497
Tested with sending an email:
Also in this PR:
create_lifecycle_executor: changed naming ofalertIdtoalertInstanceIdas that is actually what it is.