cds-snc / notification-planning-core

Project planning for GC Notify Core Team
0 stars 0 forks source link

Keep SMS usage data longer #325

Open sastels opened 5 months ago

sastels commented 5 months ago

Description

As a Notify team member, I need to see all the SMS costing data.

WHY are we building?

We would like to know what services have been spending on SMS in the long term. Currently we keep a one week snapshot of the data.

WHAT are we building?

We are modifying the current system so that we do not delete the SMS usage data after a week. Note that currently the data contains destination phone numbers. We will need to remove those before we can keep the data long term.

VALUE created by our solution

Better estimate on service costs.

Acceptance Criteria

QA Steps

sastels commented 5 months ago

Started with a script that will sanitize the usage logs and move to a different bucket that has no retention policy. https://github.com/cds-snc/notification-terraform/pull/1256

sastels commented 5 months ago

pr merged, ran the script, new sanitized files in new bucket :tada: Have to see what happened overnight in QuickSight...

dang it, the destination numbers are still there :/ Must not be looking to the correct bucket somehow. Will investigate...

sastels commented 5 months ago

The manifest file, which I smartly moved to the new bucket so it wouldn't expire, still points to the old bucket. Will fix after more caffeine...

sastels commented 5 months ago

Fix the manifest file https://github.com/cds-snc/notification-terraform/pull/1276

sastels commented 5 months ago

ok, remaining is to have a GitHub actio run this script every day

P0NDER0SA commented 4 months ago

This one is approved as well! moving to QA

sastels commented 4 months ago

PR for github action https://github.com/cds-snc/notification-terraform/pull/1294

P0NDER0SA commented 4 months ago

Jimmy will QA

sastels commented 4 months ago

PR approved, will be merged today

sastels commented 4 months ago

merged in, will release today and then we can QA

ben851 commented 4 months ago

Needs to be released to prod and QA'ed

sastels commented 4 months ago
sastels commented 4 months ago

One thing we haven't done yet is use the us-west-2 data. It's being sanitized and stored but not added to QuickSight.

We should see if we can get the initial SMSUsage dataset to use that bucket along with the ca-central-1 bucket. ie can we create a dataset from 2 buckets? :thinking:

sastels commented 4 months ago

ooo you can just give a list of buckets to pull data from in the manifest file. Easy-peasy.

https://github.com/cds-snc/notification-terraform/pull/1304

sastels commented 4 months ago

merged and ready for release.

After release we can manually refresh the datasets to check if the us-west-2 data has been added.

ben851 commented 4 months ago

We haven't done a Terraform release recently. Need to get this in there.

ben851 commented 4 months ago

Terraform release went poorly yesterday - in that we never applied it... Will try again today.

sastels commented 4 months ago

I think all is in prod now :tada:

Ready for QA

sastels commented 4 months ago

Brought back from Done - SMSUsage dataset has duplicate rows. We need to dedup them (ie one line per message id). Started a PR to do this as part of removing the PII https://github.com/cds-snc/notification-terraform/pull/1335

P0NDER0SA commented 4 months ago

will be merged soon then we can QA it.

sastels commented 4 months ago

Update the prod sanitizer script: https://github.com/cds-snc/notification-terraform/pull/1345

sastels commented 3 months ago

all merged and running

ben851 commented 3 months ago

@sastels to run the de-duplicate data in prod, and will be qa'ed

sastels commented 3 months ago

remaining: refresh the "Notifications with SMS pricing" dataset. This is a 45 minute join of the full notifications dataset with the SMSUsage dataset - I decided to leave this to the nightly refresh.

sastels commented 3 months ago
ben851 commented 3 months ago

@Jimmy has assigned it to himself to QA

jimleroyer commented 3 months ago

I downloaded the sanitized report for June 9th and there were no duplicate message IDs sitting in the file, using a quick duplicate finder script. So this is all ✅.