-
Notifications
You must be signed in to change notification settings - Fork 1
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
Implement remaining product metrics #196
Conversation
This will allow us to create a dashboard of the unique number of caseworker users.
This will facilitate creating dashboards broken out per site.
b052fdf
to
e9c6024
Compare
This necessitates passing the `current_user` object into the CbvInvitationService, but necessary if we want to have a NewRelic understanding of the number of invitations per caseworker.
We need to track a few fields in order to give us metrics on how mayn accounts are linked, as well as the number of paystubs and account descriptions. This logic gets me worried for bugs, since it's in a critical place, so I'm putting it in a rescue block so it doesn't break the sending of the actual documents.
This commit adds metadata tracking for the seconds in two intervals: 1. invitation sent and flow start, and 2. flow start and flow completion Although, these can be reconstituted later from the database timestamps, it might be best to just send them to NewRelic so we can put them on a dashboard easily.
We will set NEW_RELIC_ENV=demo on our demo site, and NEW_RELIC_ENV=production on our production site.
e9c6024
to
05017d7
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.
LGTM
let(:cbv_flow_invitation) { cbv_flow.cbv_flow_invitation } | ||
|
||
before do | ||
session[:cbv_flow_invitation] = cbv_flow_invitation | ||
end | ||
|
||
around do |ex| |
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.
what's going on here?
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 make an assertion in the test that it calculates the number of "seconds since flow started" correctly, so freezing time is necessary so the calculation is exact (and doesn't take into account the time it took for the test to run).
@@ -1,4 +1,6 @@ | |||
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController | |||
after_action :track_event |
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.
😎
Ticket
Resolves FFS-705.
Changes
site_id
to all NewRelic eventsuser_id
to ApplicantInvitedToFlow NewRelic eventsContext for reviewers
When we initially implemented NewRelic, it was too early and we didn't have all
the constructs necessary to instrument these product metrics. Now, we do, so
I've added metadata to various parts in order to capture all the metrics in the
attached ticket.
Testing
Now that the NewRelic account is set up, the easiest way to validate this change
is to merge this, build the dashboards, and then accept the ticket based off of
the dashboards as data flows in.