New to Kestra?
Use blueprints to kickstart your first workflows.
Monitor Amazon SQS message age and consumer lag with Kestra. Query CloudWatch metrics, open GitHub issues, and alert Slack.
Asynchronous event-driven architectures rely on Amazon SQS queues to decouple producers from background processing consumers. When consumer pods crash, encounter database deadlock stalls, or scale insufficiently during traffic spikes, messages accumulate and age in the queue. This blueprint monitors CloudWatch ApproximateAgeOfOldestMessage metrics, detects SLA breaches, opens an automated GitHub tracking ticket, and alerts the messaging team on Slack.
periodic_sqs_age_check runs every 15 minutes.probe_sqs_age_metric queries CloudWatch for Maximum ApproximateAgeOfOldestMessage.evaluate_message_age evaluates if age exceeds SLA threshold.branch_on_age_breach logs a GitHub issue and alerts Slack if breached.log_audit_complete logs final outcome.errors block alerts Slack on execution failure.Kestra unifies AWS CloudWatch querying, conditional escalation, and chat notifications in a single auditable workflow.
AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY: AWS credentials.GITHUB_TOKEN: GitHub token.SLACK_WEBHOOK: Slack webhook URL.aws_region: Target region.queue_name: SQS queue name.max_age_seconds_threshold: Max age before alerting.target_repository: GitHub repository.outputs.evaluate_message_age.value.oldest_age_seconds: Age of oldest message.outputs.evaluate_message_age.value.is_sla_breached: Boolean breach flag.