Working code to generate metrics for SQS