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 4490f61 commit 5b00a59
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/poller/poller-core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,11 @@ function getMaxMetricValue(projectId, spannerInstanceId, metric) {
view: 'FULL',
};

return metricsClient.listTimeSeries(request).then((metricResponses) => {
const options = {
timeout: 60 // seconds

Check failure on line 236 in src/poller/poller-core/index.js

View workflow job for this annotation

GitHub Actions / Analyze

Insert `,`
};

return metricsClient.listTimeSeries(request, options).then((metricResponses) => {

Check failure on line 239 in src/poller/poller-core/index.js

View workflow job for this annotation

GitHub Actions / Analyze

Replace `.listTimeSeries(request,·options)` with `⏎····.listTimeSeries(request,·options)⏎····`
const resources = metricResponses[0];

Check failure on line 240 in src/poller/poller-core/index.js

View workflow job for this annotation

GitHub Actions / Analyze

Insert `··`
let maxValue = 0.0;

Check failure on line 241 in src/poller/poller-core/index.js

View workflow job for this annotation

GitHub Actions / Analyze

Insert `··`
let maxLocation = 'global';

Check failure on line 242 in src/poller/poller-core/index.js

View workflow job for this annotation

GitHub Actions / Analyze

Insert `··`
Expand Down

0 comments on commit 5b00a59

Please sign in to comment.