LG-4305: Log new event in case of lockout from proofing#4803
Conversation
app/services/analytics.rb
Outdated
There was a problem hiding this comment.
all the other events have lowercase rate limited, can we do that here too? Since cloudwatch regexes are case-sensitive by default it would make it easier for us to find all the rate limits with one query if we wanted to
| IAL2_RECOVERY_REQUEST_RATE_LIMIT_TRIGGERED = 'IAL2 Recovery Request Rate Limited'.freeze | |
| IAL2_RECOVERY_REQUEST_RATE_LIMIT_TRIGGERED = 'IAL2 Recovery Request rate limited'.freeze |
There was a problem hiding this comment.
Yeah, this was an unfortunate choice between consistency amongst the peer of "IAL2 Recovery Request" events vs. "rate limited" events. You raise a good point about being able to query rate limited events.
I was actually beginning to explore an alternative approach where the logging happens as part of the throttling behaviors (e.g. in or as a result of Throttler::IsThrottledElseIncrement and Throttler::Increment). To your point, this would have the added benefit of there being only one event associated with rate limits being triggered.
0377296 to
b09153f
Compare
|
Exploring a couple alternatives:
cc also @amathews-fs , re: our chat yesterday. Still tinkering here, and finalizing details around tests. |
**Why**: As a login.gov developer, i want to see an event in the event log that indicates that a user was locked out for 6 hours from proofing along with the relevant data points that directly resulted in that lockout, so that I can troubleshoot any issues reported by end users and pinpoint exactly what caused the lock out.
**Why**: Easier queryability of events, fewer and more consistent events, compatibility with potential future refactor to move event logging into throttle service or model.
**Why**: Encapsulate behaviors of throttling within existing service behaviors
28dd326 to
dd52cee
Compare
|
I created a follow-up ticket LG-4404 to log events for non-proofing throttle types. |
Why: As a login.gov developer, I want to see an event in the event log that indicates that a user was locked out for 6 hours from proofing along with the relevant data points that directly resulted in that lockout, so that I can troubleshoot any issues reported by end users and pinpoint exactly what caused the lock out.