mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 14:10:49 -05:00
* feat(sqs): publish AWS/SQS queue metrics to CloudWatch Every active queue now reports the AWS/SQS metrics once a minute on the QueueName dimension: the depth gauges, ApproximateAgeOfOldestMessage, the send, receive, delete and empty-receive counters, SentMessageSize, and for FIFO queues the in-flight groups and deduplicated sends. The samples follow what SQS sends on AWS, so alarms, GetMetricData and GetMetricStatistics see queue metrics without PutMetricData. The CloudWatch metric store is now journaled under persistent mode, as the CloudWatch Logs event store is, since it takes a write per metric per active queue every minute. Closes #6275 * fix(sqs): stamp queue metrics with the minute that ended The publisher now ticks just after each minute boundary and stamps its samples with the minute that ended, so a call counts in the minute it was made instead of the minute of a startup-relative tick. A queue whose write fails no longer stops the others, and the log names it. A queue deleted and created again between the snapshot and the lookup is skipped instead of reporting the old queue's depth under the new one. * fix(sqs): bound AWS/SQS metric history and finish the tick on shutdown The publisher now drops AWS/SQS datapoints older than the 15 days AWS keeps one-minute data, once an hour, so the history it generates for an active queue stays bounded. On shutdown it stops before the storage flush and waits for a running tick, so the last minute is not written after the store closed. * test(sqs): keep the scheduled metrics tick out of the test run The acceptance test publishes its own ticks, but the scheduled one could still stamp the test queue's depth into a complete period newer than them, since a tick stamps the minute that just ended. floci.services.sqs. cloudwatch-metrics-enabled now turns the tick off, and the test configuration does, as it does for the S3 lifecycle sweep. It also lets a user opt out of the AWS/SQS metric volume. * test(sqs): build the metrics test's queue service with SqsServiceFactory