From 5b00a59e9a90d40882eb1c081a2cf9fd6b2bab6b Mon Sep 17 00:00:00 2001 From: Kaelan Mikowicz Date: Thu, 31 Oct 2024 15:38:57 -0700 Subject: [PATCH] listTimeSeries: increase timeout from 30 seconds to 60 seconds The poller may often receive timeouts from the GCP monitoring API. I have received advice from GCP support and product team to increase the timeout of calls made from the poller cloud function. Given that the maximum frequency of the cloud scheduler can be once per minute, a timeout period of 60 seconds makes sense and should reduce the amount of errors from the poller function --- src/poller/poller-core/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/poller/poller-core/index.js b/src/poller/poller-core/index.js index 315e30d7..402940b7 100644 --- a/src/poller/poller-core/index.js +++ b/src/poller/poller-core/index.js @@ -232,7 +232,11 @@ function getMaxMetricValue(projectId, spannerInstanceId, metric) { view: 'FULL', }; - return metricsClient.listTimeSeries(request).then((metricResponses) => { + const options = { + timeout: 60 // seconds + }; + + return metricsClient.listTimeSeries(request, options).then((metricResponses) => { const resources = metricResponses[0]; let maxValue = 0.0; let maxLocation = 'global';