Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
7 tasks done
trentm opened this issue Sep 6, 2023 · 1 comment
Closed
7 tasks done

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

trentm opened this issue Sep 6, 2023 · 1 comment
Assignees

Comments

@trentm
Copy link
Member

trentm commented Sep 6, 2023

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

@trentm
Copy link
Member Author

trentm commented Sep 20, 2023

All the relevant agents (not PHP because it doesn't yet do cloud metadata collection) have a fix in now. I'm not tracking what release has it for each agent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant