mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-23 08:51:30 -05:00
Turn off statsd wrapper for synchronous statsd calls during POSTs
This commit turns off StatsD metrics for the following - the `dao_create_notification` function - the `user-agent` metric - the response times and response codes per flask endpoint This has been done with the purpose of not having the creation of text messages or emails call out to StatsD during the request process. These are the three current metrics that are currently called during the processing of one of those requests and so have been removed from the API. The reason for removing the calls out to StatsD when processing a request to send a notification is that we have seen two incidents recently affected by DNS resolution for StatsD (either by a slow down in resolution time or a failure to resolve). These POST requests are our most critical code path and we don't want them to be affected by any potential unforeseen trouble with StatsD DNS resolution. We are not going to miss the removal of these metrics. - the `dao_create_notification` metric is rarely/never looked at - the `user-agent` metric is rarely/never looked at and can be got from our logs if we want it - the response times and response codes per flask endpoint are already exposed using the gds metrics python library I did not remove the statsd metrics from any other parts of the API because - As the POST notification endpoints are the main source of web traffic, we should have already removed most calls to StatsD which should greatly reduce the chance of their being any further issues with DNS resolution - Some of the other metrics still provide value so no point deleting them if we don't need to - The metrics on celery tasks will not affect any HTTP requests from users as they are async and also we do not currently have the infrastructure set up to replace them with a prometheus HTTP endpoint that can be scraped so this would require more work
This commit is contained in:
@@ -77,7 +77,6 @@ def dao_get_last_date_template_was_used(template_id, service_id):
|
||||
return last_date
|
||||
|
||||
|
||||
@statsd(namespace="dao")
|
||||
@transactional
|
||||
def dao_create_notification(notification):
|
||||
if not notification.id:
|
||||
|
||||
Reference in New Issue
Block a user