Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this change?
The reliability team has provided a very useful doc about how to incorporate metrics into our notification platform.
This PR adds metrics to the notification app only:
This PR also changes the logic for how duration is calculated: previously the duration didn't account for the Future completing so the duration looked to always be ~0ms. Now I'm seeing more realistic durations (600-1700ms).
I can see that the metrics are being pushed to cloudwatch as expected:
![Screenshot 2022-08-19 at 15 06 04](https://user-images.githubusercontent.com/45561419/185636482-2467d9ea-16f7-4eae-b70c-ddd9e69d0e24.png)
How to test
I pushed to CODE, sent a couple of test notifications and checked:
How can we measure success?
Given we publish these metrics I think we'll have the observability we need to monitor the notification app.
Have we considered potential risks?
We're pushing custom metrics which incurs additional cost, but I'm not using additional dimensions which hopefully controls this additional cost ($0.30 per month, $0.01 per 1,000 requests).