feat: add SQS queue insights and quit confirmation modal#3
Merged
Conversation
Add QueueCloudWatchMetrics, InsightSeverity, QueueInsight, and QueueInsights types. Implement compute_queue_insights() to analyze queue behavior using SQS attributes and optional CloudWatch metrics. Add wildcard matching and friendly filter support for search queries.
Update SqsDetailLoaded to include queue_url for proper metric association. Add SqsCloudWatchLoaded event for async metric fetch results.
Add StatusMessage type with severity levels (Info, Success, Error). Add queue insights state management and CloudWatch metrics loading. Implement 'q' key for quit confirmation modal and Cmd+R for manual refresh. Update search filtering to use friendly wildcard matching. Handle async CloudWatch metric fetches and compute insights on load.
Add insights rendering above attributes table showing drain outlook, time-to-empty, completion pressure, oldest message risk, and processing pressure signals with color-coded severity indicators.
Add quit confirm view to UI dispatcher and update color constants for better consistency (DarkGray → Gray). Update help and status messages for new keybindings.
Minor updates to SNS service and config module for CloudWatch metrics support.
Enable crossterm keyboard enhancement when supported by terminal. Improves key event disambiguation and enables advanced key reporting.
Add SQS queue insights feature with CloudWatch-backed signals. Document wildcard and friendly search filtering with examples. Add AWS permissions section detailing required IAM permissions. Update keybindings for quit confirmation modal (q vs Ctrl+C).
Replace terse state labels (Growing, Draining, Lagging, etc.) with full-sentence detail messages that describe what is happening and why. Extract helpers (insight, completion_insight, compute_oldest_message_risk, compute_processing_pressure) to reduce repetition. Add absolute age thresholds alongside retention-ratio thresholds, max_severity utility, and a SeverityMessage trait for inline message pairing. Update tests to match new state strings and add two new test cases.
Rename "Drain Outlook" → "Backlog Trend", "Oldest Risk" → "Oldest Message" and "Queue Insights" panel title → "Queue Signals" for clarity.
df34156 to
4c2564b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces two major features to enhance the SQS queue browsing experience:
SQS Queue Insights: A new panel in queue detail view that displays CloudWatch-backed signals including drain outlook, time-to-empty ETA, completion pressure, oldest message risk, and processing pressure. Gracefully degrades when CloudWatch metrics are unavailable.
Quit Confirmation Modal: A user-friendly confirmation dialog for the 'q' key to prevent accidental application exits while preserving the quick Ctrl+C escape hatch.
Additional Changes
*-dlq,prod-*,queue-??) and combined filter terms for flexible queue/topic discoveryTechnical Details
New types in models.rs:
QueueCloudWatchMetrics: Historical throughput and age dataQueueInsight&QueueInsights: Computed health signals with severity levelsInsightSeverity: Normal, Warning, Critical, Unavailable statesEvent system enhancements:
AppEvent::SqsDetailLoadednow includes queue_url for metric associationAppEvent::SqsCloudWatchLoadedevent for async metric resultsApp state additions:
StatusMessagetype with severity levels for improved error handlingAWS permissions required:
sqs:ListQueues,sqs:GetQueueAttributes,sns:*cloudwatch:GetMetricData(optional, gracefully handled if missing)