Skip to content

Commit

Permalink
listTimeSeries: increase timeout from 30 seconds to 60 seconds
Browse files Browse the repository at this point in the history
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
  • Loading branch information
klanmiko committed Oct 31, 2024
1 parent d27046f commit 50ffe48
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion poller/poller-core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,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];
maxValue = 0.0;
for (const resource of resources) {
Expand Down

0 comments on commit 50ffe48

Please sign in to comment.