Skip to content

Commit 5b00a59

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 4490f61 commit 5b00a59

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/poller/poller-core/index.js

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

235-
return metricsClient.listTimeSeries(request).then((metricResponses) => {
235+
const options = {
236+
timeout: 60 // seconds
237+
};
238+
239+
return metricsClient.listTimeSeries(request, options).then((metricResponses) => {
236240
const resources = metricResponses[0];
237241
let maxValue = 0.0;
238242
let maxLocation = 'global';

0 commit comments

Comments
 (0)