Please sign in to comment.
Clarify the relationship between where, where-event, and match.
(where expr) rewrites expr in complex ways, as well as binding symbols like 'event, 'metric, and 'state. In cases where you want to write a predicate without symbol capture, (where-event event-name expr) allowed you to bind the event to an arbitrary symbol inside expr. We already have a system for binding variables in scope: function arguments. We also have a large library of functions which take events and return truthy values. It made sense to consolidate these two into a new stream: (where* f), which takes a *function* of an event instead of an expression. (where*) does not rewrite its arguments, except to provide (where)'s (else ...) blocks. (where-event) is gone; (where*) provides all its functionality in a more composable way. (match) has been underappreciated for a while now. I've made it more powerful by using the new Match protocol in riemann.common, which allows it to apply functions, regexes, sets, and values as predicates for matching aspects of an event. It should be a solid complement to (where) with these changes.
- Loading branch information...
Showing with 84 additions and 43 deletions.