Skip to content

changes to metadata.cloud.project.* fields collected for GCP #826

@trentm

Description

@trentm

Description

#822 changed a few spec details for metadata.cloud.project.* fields collected for GCP. Here are the things you should change/check in your implementation. See the spec PR for justification for each change:

  1. Change cloud.project.id to use GCE metadata project.projectId, instead of project.numericProjectId (aka "project number").
  2. Stop collecting cloud.project.name.
  3. Check that you collect cloud.instance.id correctly. The instance.id from the GCE metadata is an int that typically has values larger than 2**53 – 1. It is possible your JSON parser could be surprised by it. For example, the JavaScript one gets it wrong, because JavaScript is weird and uses floats for all numbers and the big int here exceeds JavaScript's Number.MAX_SAFE_INTEGER:
    > JSON.parse('{"id": 7774572792595385001}')
    { id: 7774572792595385000 } // oops
    The Python implementation is fine.
  4. Check that you collect cloud.region correctly. The spec's previous description for how to get the cloud.region was wrong. For example, given GCE metadata with {"instance": {"zone": "projects/123456789012/zones/us-west1-b"}} you should collect us-west1.

Agent Issues

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions