Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

fix(metrics): ensure email events use stashed flow data where applicable #2677

Merged
merged 1 commit into from Oct 23, 2018

Conversation

philbooth
Copy link
Contributor

Fixes #2675.

A number of places that were sending emails assumed they had access to flowId and flowBeginTime on the request payload. However, we're in the process of changing some of those endpoints so that they don't receive metrics context data in the payload.

To fix this, all endpoints are changed here to read metrics context data via a lazy getter that falls back to loading from memcached if there's no flow data in the payload. This happened to be a nice refactor anyway, fitting in with our broader adoption of lazy getters. It makes the code more resilient to change and reduces the frequency that we hit the cache with.

Note this is the same commit as #2676, but opened against the correct train branch because I am a short-sighted fool.

@vbudhram r?

A number of places that were sending emails assumed they had access to
flowId and flowBeginTime on the request payload. However, we're in the
process of changing some of those endpoints so that they don't receive
metrics context data in the payload.

To fix this, all endpoints are changed here to read metrics context data
via a lazy getter that falls back to loading from memcached if there's
no flow data in the payload. This happened to be a nice refactor anyway,
fitting in with our broader adoption of lazy getters. It makes the code
more resilient to change and reduces the frequency that we hit the cache
with.
Copy link
Contributor

@vbudhram vbudhram left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@philbooth LGTM 👍

@philbooth philbooth merged commit 43ba51a into train-123 Oct 23, 2018
@philbooth philbooth deleted the pb/lazy-getter-metrics-context branch October 23, 2018 17:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants