-
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
[Alerting Core] Add timestamp to provided template values #67389
Comments
Pinging @elastic/kibana-alerting-services (Team:Alerting Services) |
not sure if it belongs here, but it would be useful to have |
Wow, from last May, sorry for the very delayed response. Probably is the wrong place, but some thoughts - open a new issue for further discussion if you'd likee. Sounds like you could maintain the timestamp in the alert instance state, or even the alert state. But it's going to be overwritten the next time the executor runs (presumably), or "erased" if the instance didn't schedule any actions, or if in the alert state, you'll have to manage the lifetime it's in the state. So I'm not sure there's much point in trying to keep that in sync. Note: the state gets destroyed when the alert is disabled, so should not be considered totally persistent. There should be an event log record for this though. There should be an |
I happened to notice that we need to add the "action group" to the top-level template variables, as well as the timestamp. Should do both at the same time, I'd guess. Maybe poke around the alert and see if there's more? Note that the executionStatus property is reset based on the whether instances schedule action groups, and perhaps is not set to it's "current state" by the time the values are interpolated, so that might not be a good candidate, right now. |
I'm starting to look into this one, wondering what variable value the "date" should have. Currently I'm going with ISO, but that seems not very human friendly. Perhaps we could extend the date variable to an object, with properties that are methods, that would let you select a particular timezone or date format to use; eg |
…r actions resolves: elastic#67389
…r actions (#83195) resolves: #67389 Adds new variables to the existing set of variables that can be used in mustache templates to be used in action parameters when creating alerts. - `alertActionGroup` - the action group associated with the alert scheduling actions - `date` - the current date, in ISO format
…r actions (elastic#83195) resolves: elastic#67389 Adds new variables to the existing set of variables that can be used in mustache templates to be used in action parameters when creating alerts. - `alertActionGroup` - the action group associated with the alert scheduling actions - `date` - the current date, in ISO format
…r actions (elastic#83195) resolves: elastic#67389 Adds new variables to the existing set of variables that can be used in mustache templates to be used in action parameters when creating alerts. - `alertActionGroup` - the action group associated with the alert scheduling actions - `date` - the current date, in ISO format
…r actions (#83195) (#83828) resolves: #67389 Adds new variables to the existing set of variables that can be used in mustache templates to be used in action parameters when creating alerts. - `alertActionGroup` - the action group associated with the alert scheduling actions - `date` - the current date, in ISO format
By default it looks like alerts provide alert message templates with some core values like
alertId
,alertName
,spaceId
,tags
, etc. We'd also like to have atimestamp
value available that represents the exact time at which the executor ran when it encountered the triggering event.The text was updated successfully, but these errors were encountered: