-
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
Add context.alertDetailsUrl to connector template when configuring a Rule #142854
Add context.alertDetailsUrl to connector template when configuring a Rule #142854
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is cool, @CoenWarmer. Did you consider Kibana spaces in the URL?
Thanks @fkanout; re: spaces: Not yet, will do! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
infra
plugin changes LGTM, well done 👍 and thanks for adding the space awareness to the URLs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…-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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can we change this back to alertId
as well?
Summary
Adds the
context.alertDetailsUrl
variable when configuring a connector template.Resolves #139923
Resolves #141497
Tested with sending an email:
Also in this PR:
create_lifecycle_executor
: changed naming ofalertId
toalertInstanceId
as that is actually what it is.