-
Notifications
You must be signed in to change notification settings - Fork 47
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
empty string in ruby is not falsy, adding empty? check to only add tag dimension if it is present #44
Conversation
…ag dimension if it is present
lib/sidekiq/cloudwatchmetrics.rb
Outdated
@@ -189,7 +189,7 @@ def publish | |||
unless process_utilization.nan? | |||
process_dimensions = [{name: "Hostname", value: process["hostname"]}] | |||
|
|||
if process["tag"] | |||
unless process['tag'].empty? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible that process["tag"]
is nil
?
if process["tag"] && !process["tag"].empty?
(Please keep in mind I'm a random dev and not the repository maintainer.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, for those apps which are Rails based
Yes, for those apps which are only Ruby based
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've run into the same error. Can this be merged in please
Nice find, thanks! |
Ah, now this introduced another error:
|
This PR is opened against this issue
Where the check

if process["tag"]
is returning true in case of empty string, which caused the issue for aws-sdk-cloudwatch library