-
Notifications
You must be signed in to change notification settings - Fork 66
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
EZR: Add VANotify callback metadata to email notify job #20093
base: master
Are you sure you want to change the base?
Conversation
842ccbe
to
3dd387d
Compare
3dd387d
to
ee177cb
Compare
ee177cb
to
013b6c6
Compare
api_key | ||
api_key, | ||
{ | ||
callback_metadata: { notification_type: 'error', form_number: FORM_ID, statsd_tags: DD_ZSF_TAGS } |
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 didn't realize this before, but the statsd_tags
value needs to be a hash not an array. The DefaultCallback
class currently expects it as a hash since it pulls out the service/function and their values and formats them in the array of strings we expect to pass to statsd metrics. I actually have a PR open to allow for both arrays and hashes in the DefaultCallback class, but at the moment this won't correctly add the tags.
db26149
to
75e866d
Compare
'service:healthcare-application', | ||
'function: 10-10EZR async form submission' | ||
].freeze | ||
DD_ZSF_TAGS = { |
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.
So, my only concern with doing it this way is that now the DD_ZSF_TAGS
can't be passed directly to the statsd increment call since the formatting is different (array vs hash). If we look at the other places we set the DD_ZSF_TAGS
, it will be an array of strings. Does it feel weird to map over this and format it as a hash? This was why I want to update the default behavior to allow for the array, since I think it makes it much cleaner. If we do get that merged in you can revert it back to an array, but honestly in the meantime I'm not sure which way I prefer 🤷 . Thoughts?
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 started to do something similar for the EZ, but for now I'm waiting to see if I can get my global change in to the default_callbacks. master...93247-statsd-tags-hash for reference
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 think I'm confused why you need to map the hash back to an array. You mentioned that we can't pass the DD_ZSF_TAGS
as a hash to the statsd call and I removed the line where we were passing the tags to the call.
I thought it was the VANotify::EmailJob.perform_async(*params)
call that needed the tags to be in hash format, which is where the DD_ZSF_TAGS
are being passed to?
I see that you still have this line in your branch, but maybe you meant to remove it?
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 left that line in for when the flipper toggle is turned off to still increment the zsf statsd metric. That was my concern here. If you needed to pass the tags to an increment call the format would be wrong. I'm probably overthinking it though.
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.
Okay I see. This entire method is guarded by the feature flag, so I think even if it is off, this code is unaffected by the hash/array conversions.
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.
@coope93 Any other concerns with this PR?
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, this looks good 👍 . Just an fyi, I merged in this PR to allow for passing the array and not just the hash for the default_callbacks. It's currently turned on in staging but turned off in prod. But once that's turned on it could make sense to switch these back to an array just for consistency with the other places we set DD_ZSF_TAGS
75e866d
to
3edea9e
Compare
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.
So one last comment, but after talking with Nathan Wright on the VANotify team, I don't think we want to merge this change in just yet. The default callbacks currently only work for the vets-api
service, and I believe this email is in our 1010 health apps service. We discovered that when testing this, and he updated staging to include our service so we could keep moving forward on it. So you should be able to confirm the behavior in staging, but if this is deployed to production the callbacks will not work. So we may want to put this behavior behind it's own toggle or just hold off for a bit 🤷
'service:healthcare-application', | ||
'function: 10-10EZR async form submission' | ||
].freeze | ||
DD_ZSF_TAGS = { |
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, this looks good 👍 . Just an fyi, I merged in this PR to allow for passing the array and not just the hash for the default_callbacks. It's currently turned on in staging but turned off in prod. But once that's turned on it could make sense to switch these back to an array just for consistency with the other places we set DD_ZSF_TAGS
@dellerbie can you have a teammate review, then I'll review |
Okay I see. It makes sense to hold off since the fix is making its way to production soon. I'll just put this back into draft state for now. |
Summary
Related issue(s)
Testing done
What areas of the site does it impact?
Form 10-10 EZR
Acceptance criteria