Skip to content

Commit 50ffe48

Browse files
committed
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
1 parent d27046f commit 50ffe48

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

poller/poller-core/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,11 @@ function getMaxMetricValue(projectId, spannerInstanceId, metric) {
149149
view: 'FULL'
150150
};
151151

152-
return metricsClient.listTimeSeries(request).then(metricResponses => {
152+
const options = {
153+
timeout: 60, // seconds
154+
}
155+
156+
return metricsClient.listTimeSeries(request, options).then(metricResponses => {
153157
const resources = metricResponses[0];
154158
maxValue = 0.0;
155159
for (const resource of resources) {

0 commit comments

Comments
 (0)