Monitoring middleware