Fix CSV Export in monitoring module.

Fixes #5722