def annotate_filter(**decargs):
    """Add input and output watermarks to filtered events."""
    def decorator(func):
        """Annotate events with entry and/or exit timestamps."""
        def wrapper(event, *args, **kwargs):
            """Add enter and exit annotations to the processed event."""
            funcname = ":".join([func.__module__, func.__name__])
            enter_key = funcname + "|enter"
            annotate_event(event, enter_key, **decargs)
            out = func(event, *args, **kwargs)
            exit_key = funcname + "|exit"
            annotate_event(event, exit_key, **decargs)
            return out

        return wrapper
    return decorator