ministryofjustice / operations-engineering

This repository is home to the Operations Engineering's tools and utilities for managing, monitoring, and optimising software development processes at the Ministry of Justice. • This repository is defined and managed in Terraform
https://user-guide.operations-engineering.service.justice.gov.uk/
MIT License
14 stars 5 forks source link

Transaction Consumption of prisoner-content-hub-frontend #2541

Closed connormaglynn closed 1 year ago

connormaglynn commented 1 year ago

Background 👀 Please read the Epic for full context.

prisoner-content-hub-frontend is our largest consumer of transactions. In the past 30 days, it has consumed ~6million transactions, ~20% of the MoJs total monthly quota.

Task 🚀 Consult with the team responsible for prisoner-content-hub-frontend to understand better the value they receive out of the errors and how Operations Engineering can help.

Proposed Solutions ✅

Useful 🧠

Acceptance Criteria 🎯 This ticket is complete when consultation has taken place with the team and one of the following is true:

connormaglynn commented 1 year ago

After an initial investigation, it's apparent that POST /analytics/page is disproportionality in most of the transactions.

After looking at the code, this endpoint is called on every page load as a technical workaround to send information to Google Analytics. Therefor, the data being sent to Sentry is presumably of little value for the volume of transactions.

The developer also suggested that they mainly use Sentry for error reporting, and therefor the transactions are not as valuable.

I will suggest to the team the following:

With these proposed changes, we will reduce the transaction consumption from ~6million per month to ~1million. Saving ~5million transactions per month, with minimal impact to the value the team gets from Sentry.

connormaglynn commented 1 year ago

PR raised, just awaiting approvals https://github.com/ministryofjustice/prisoner-content-hub-frontend/pull/647

connormaglynn commented 1 year ago

Deployed prisoner-content-hub-frontend Sentry Configuration to production (the team was nice enough to let me run this all the way through)

connormaglynn commented 1 year ago

We'll need about a weeks worth of data to get an accurate(ish) projection since it's high traffic and fluctuates a lot.

I'll move into blocked until we have more data for an accurate analysis of the impact of these changes.

For reference, we're projected to use 28Million transactions this period in Sentry.

connormaglynn commented 1 year ago

Verified that these changes are now in production and has reduced overall consumption of our quota by ~18%