From 07dee6640e0f6076e8145157d88c4378ce53841f Mon Sep 17 00:00:00 2001 From: Richard Towers Date: Fri, 2 Aug 2024 12:26:06 +0100 Subject: [PATCH] Report publishing-api metrics to prometheus hourly 22 minutes past the hour is a random choice. Choosing a random value rather than 0 to avoid a situation where everything happens exactly on the hour causing load spikes. --- charts/app-config/values-integration.yaml | 3 +++ charts/app-config/values-production.yaml | 3 +++ charts/app-config/values-staging.yaml | 3 +++ 3 files changed, 9 insertions(+) diff --git a/charts/app-config/values-integration.yaml b/charts/app-config/values-integration.yaml index 1f13f5778d2..1b8a437819b 100644 --- a/charts/app-config/values-integration.yaml +++ b/charts/app-config/values-integration.yaml @@ -1852,6 +1852,9 @@ govukApplications: - name: events-export task: "events:export_to_s3" schedule: "38 5 * * 0" + - name: metrics-report-to-prometheus + task: "metrics:report_to_prometheus" + schedule: "22 * * * *" # every hour, at 22 minutes past the hour # In non-production envs, run Search API v2 bulk import every week to bring it to parity # with Publishing API state (which gets refreshed from production DB every night). - name: search-api-v2-bulk-import diff --git a/charts/app-config/values-production.yaml b/charts/app-config/values-production.yaml index 28a90479ebf..54e11e12cc5 100644 --- a/charts/app-config/values-production.yaml +++ b/charts/app-config/values-production.yaml @@ -1892,6 +1892,9 @@ govukApplications: - name: events-export task: "events:export_to_s3" schedule: "38 5 * * 0" + - name: metrics-report-to-prometheus + task: "metrics:report_to_prometheus" + schedule: "22 * * * *" # every hour, at 22 minutes past the hour - name: search-api-v2-bulk-import task: "queue:requeue_all_the_ever_published_things[bulk.search_api_v2_sync]" schedule: "0 0 1 11 *" # arbitrary value (only used as a template but field is required) diff --git a/charts/app-config/values-staging.yaml b/charts/app-config/values-staging.yaml index 54951c0cc28..3fbad529aea 100644 --- a/charts/app-config/values-staging.yaml +++ b/charts/app-config/values-staging.yaml @@ -1886,6 +1886,9 @@ govukApplications: - name: events-export task: "events:export_to_s3" schedule: "38 5 * * 0" + - name: metrics-report-to-prometheus + task: "metrics:report_to_prometheus" + schedule: "22 * * * *" # every hour, at 22 minutes past the hour # In non-production envs, run Search API v2 bulk import every week to bring it to parity # with Publishing API state (which gets refreshed from production DB every night). - name: search-api-v2-bulk-import