-
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] Consider consolidating context
and state
action variables
#120540
Comments
Pinging @elastic/kibana-alerting-services (Team:Alerting Services) |
I think conflating these two is not great, but I can definitely see why it can be confusing to users. We don't want rule providers shaping their state just so it can be more easily accessed as mustache variables, for instance. I don't think we initially envisioned even making the state available as mustache variables - guessing we might have said, way back when "oh, we can add this to the context!" (it was probably me!). I'd prefer we just remove the |
Pinging @elastic/response-ops (Team:ResponseOps) |
@cnasikas was this added to the team board to re-triage? |
Hey @mikecote! I got pinged because of the |
@cnasikas Gotcha, I see you added |
Oh, you are right! I forgot about it 😊. I removed it again. |
The alerting framework allows rule types to specify context variables, which are short-lived and only defined for the lifecycle of the rule execution, and state variables, which persist across multiple rule executions. While this distinction makes sense for rule type producers to be aware of, it is a detail that users don't necessarily need to know about. Currently in the UI, when selecting from the action variable dropdown, context variables have a
context.
prefix and state variables have astate.
prefix. We should consider consolidating them under a single prefix and deprecating the outdated ones. Note that on the server side, we will still need to supportcontext.
andstate.
prefixes for older actions because migrating action variables is too brittle.We could consider using a different prefix altogether like
message.*
or moving allstate
variables under thecontext.*
prefix (which would involve fewer deprecations). We should also consider the likeliehood of field clashes if a rule type defines a state and context variable with the same field name (I don't believe this is currently happening).The text was updated successfully, but these errors were encountered: