Skip to content
This repository was archived by the owner on Jan 21, 2026. It is now read-only.
This repository was archived by the owner on Jan 21, 2026. It is now read-only.

Cloud Run metadata lag #1114

@gotwalt

Description

@gotwalt

In doing some testing with Cloud Trace agent running on Google Cloud run, we're running in to unexplained lag as the result of repeated slow requests to http://metadata.google.internal./computeMetadata/v1/instance/service-accounts/?recursive=true. These requests typically take ~5s and appear randomly across requests as far as we can tell.

Screen Shot 2019-09-10 at 5 12 52 PM

The call stack for those metadata calls:

requestTrace (/opt/xxx/node_modules/@google-cloud/trace-agent/build/src/plugins/plugin-http.js:96:26)
<anonymous function> (/opt/xxx/node_modules/node-fetch/lib/index.js:1432:15)
Promise
fetch (/opt/xxx/node_modules/node-fetch/lib/index.js:1401:9)
<anonymous function> (/opt/xxx/node_modules/@google-cloud/storage/node_modules/gaxios/src/gaxios.ts:70:27)
next [as next]
<anonymous function> (/opt/xxx/node_modules/@google-cloud/storage/node_modules/gaxios/build/src/gaxios.js:19:71)
Promise
__awaiter (/opt/xxx/node_modules/@google-cloud/storage/node_modules/gaxios/build/src/gaxios.js:15:12)
request [as request] (/opt/xxx/node_modules/@google-cloud/storage/node_modules/gaxios/build/src/gaxios.js:60:16)

Environment Details

  • Node 10 Alpine image
  • @google-cloud/trace-agent version 4.0.1

I can work on a minimal repro case, but it seems to be a function of request sampling and dynamic node instantiation, so it's hard to get a good look at whatever is causing this. Is there something I'm obviously doing wrong?

Metadata

Metadata

Assignees

Labels

api: cloudtraceIssues related to the googleapis/cloud-trace-nodejs API.priority: p2Moderately-important priority. Fix may not be included in next release.status: investigatingThe issue is under investigation, which is determined to be non-trivial.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions