Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highlight false positives in check-sqs-messages when metric is unsupported #381

Merged
merged 3 commits into from
Jun 25, 2020

Conversation

majormoses
Copy link
Member

@majormoses majormoses commented Jun 17, 2020

Pull Request Checklist

#380

General

  • Update Changelog following the conventions laid out here

  • Update README with any necessary configuration snippets

  • Binstubs are created if needed

  • RuboCop passes

  • Existing tests pass

Purpose

Highlight false positives in check-sqs-messages when metric is unsupported

Previously you could see something like this:

bundle _1.17.3_ exec ./bin/check-sqs-messages.rb -r us-east-1 -q test-sensu-380 -m ApproximateAgeOfOldestMessage -c 1
NEWER VERSION AVAILABLE: Please upgrade to AWS SDK For Ruby V3
SQSMsgs OK: 0 messages in test-sensu-380 queue

Instead this will now properly notify responders to the (now) known bug. As it appears to be an api limitation and not something we did in our code we will keep the discussion open for a proper solution but first things first is getting it to tell the truth. After the fix it should look something like this:

bundle exec ./bin/check-sqs-messages.rb -r us-east-1 -q test-sensu-380 -m ApproximateAgeOfOldestMessage -c 1
SQSMsgs UNKNOWN: failed to pull metric ApproximateAgeOfOldestMessage on queue: test-sensu-380.
available attributes: {"QueueArn"=>"arn:aws:sqs:us-east-1:REDACTED:test-sensu-380", "ApproximateNumberOfMessages"=>"2", "ApproximateNumberOfMessagesNotVisible"=>"0", "ApproximateNumberOfMessagesDelayed"=>"0", "CreatedTimestamp"=>"1592356301", "LastModifiedTimestamp"=>"1592356301", "VisibilityTimeout"=>"30", "MaximumMessageSize"=>"262144", "MessageRetentionPeriod"=>"345600", "DelaySeconds"=>"0", "ReceiveMessageWaitTimeSeconds"=>"0"}

Signed-off-by: Ben Abrams me@benabrams.it

Known Compatibility Issues

There is a bug that is being masked, this surfaces it. This will not actually break any code, system, etc but deploying this will result in several unknowns from community members.

…pported

Previously you could see something like this:
```
bundle _1.17.3_ exec ./bin/check-sqs-messages.rb -r us-east-1 -q test-sensu-380 -m ApproximateAgeOfOldestMessage -c 1
NEWER VERSION AVAILABLE: Please upgrade to AWS SDK For Ruby V3
SQSMsgs OK: 0 messages in test-sensu-380 queue
```

Instead this will now properly notify responders to the (now) known bug. As it appears to be an api limitation and not something we did in our code we will keep the discussion open for a proper solution but first things first is getting it to tell the truth. After the fix it should look something like this:
```
bundle exec ./bin/check-sqs-messages.rb -r us-east-1 -q test-sensu-380 -c 1
SQSMsgs UNKNOWN: failed to pull metric ApproximateNumberOfMessages on queue: test-sensu-380.
available attributes: {"QueueArn"=>"arn:aws:sqs:us-east-1:892476923372:test-sensu-380", "ApproximateNumberOfMessages"=>"2", "ApproximateNumberOfMessagesNotVisible"=>"0", "ApproximateNumberOfMessagesDelayed"=>"0", "CreatedTimestamp"=>"1592356301", "LastModifiedTimestamp"=>"1592356301", "VisibilityTimeout"=>"30", "MaximumMessageSize"=>"262144", "MessageRetentionPeriod"=>"345600", "DelaySeconds"=>"0", "ReceiveMessageWaitTimeSeconds"=>"0"}
```

Signed-off-by: Ben Abrams <me@benabrams.it>
Signed-off-by: Ben Abrams <me@benabrams.it>
@majormoses majormoses marked this pull request as ready for review June 17, 2020 02:44
Signed-off-by: Ben Abrams <me@benabrams.it>
@majormoses majormoses requested a review from a team June 19, 2020 22:18
@majormoses majormoses merged commit 5b6c2a9 into master Jun 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants