title: Why would SQS ApproximateNumberOfMessagesVisible & ApproximateAgeOfOldestMessage go up even when Received/Deleted metrics match Sent metrics?
body: <p>In the CloudWatch Metrics graph below, the purple line is ApproximateNumberOfMessagesVisible and red line is ApproximateAgeOfOldestMessage. They are trending up even when NumberOfMessagesReceived (orange)/NumberOfMessagesDeleted (green) match NumberOfMessagesSent (blue).</p>
  <p><a href="https://i.stack.imgur.com/BuFR4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BuFR4.png" alt="enter image description here" /></a></p>
  <p>How is this possible?</p>
  <p>In my code, I process the message in a new thread and therefore the message is almost immediately deleted from the queue. (This is not good practice in production but this is a load testing script so I don't expect or care about exceptions)</p>
  <pre><code>sqsClient.receiveMessage(queueUrl).getMessages().forEach(msg -&gt; {
      pool.execute(() -&gt; handleSqsMessage(msg));
      sqsClient.deleteMessage(queueUrl, msg.getReceiptHandle());
  });
  </code></pre>