monitoring: Fix `$this' usage in a closure