-
-
Notifications
You must be signed in to change notification settings - Fork 217
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
Report app dependency removal to DataDog #35455
base: master
Are you sure you want to change the base?
Conversation
|
||
latest_build = get_latest_build_doc(self.domain, self.id) | ||
if not latest_build: |
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.
When would there not be a latest build?
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.
The "latest_build" here refers to the previous build, as the new build has not been made at this point. So the "latest_build" could be None
if it's the first build.
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.
Ah I see, thanks for the clarification
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.
nit: to make it slightly better, you could consider naming this last_build.
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
return | ||
|
||
if has_dependencies(latest_build) and not has_dependencies(new_build): | ||
metrics_counter('commcare.app_build.dependencies_removed') |
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 like that we have simplified the approach here.
Wanted to check if this metric in itself would be useful? Don't we need the uptake as well?
I believe on datadog you can have a counter with both positive and negative values, so you get a graph with both additions and removals at once.
example here
Or we could report uptake separately, which seems easy enough to add now.
if (not latest_build or not has_dependencies(latest_build)) and has_dependencies(new_build):
metrics_counter('commcare.app_build.dependencies_added')
I would vote for the single counter with both +/-
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 believe on datadog you can have a counter with both positive and negative values, so you get a graph with both additions and removals at once.
I'll check this out. Thanks for the suggestion.
Relates to this PR
Technical Summary
Ticket
This PR increments a counter on DataDog whenever the app dependencies feature has been disabled for a build which had it enabled which allows us to track the feature drop-out rate. We don't need to know any domain information, just the overall counter.
Note that the counter is incremented during the
make_build
phase.(The related PR will be changed to support a management command which will be run to "top up" the counter with historic data)
Safety Assurance
Safety story
Tested locally as far as I could. Testing on staging will commence.
Automated test coverage
No automated tests included.
QA Plan
No formal QA will be done
Rollback instructions
Labels & Review