Skip to content

Commit

Permalink
changes to metadata.cloud.project.* fields collected for GCP
Browse files Browse the repository at this point in the history
Closes: #1899
  • Loading branch information
trentm committed Sep 7, 2023
1 parent be5f6b3 commit 4d4be04
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion elasticapm/utils/cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def gcp_metadata():
return {
"provider": "gcp",
"instance": {"id": str(metadata["instance"]["id"]), "name": metadata["instance"]["name"]},
"project": {"id": str(metadata["project"]["numericProjectId"]), "name": metadata["project"]["projectId"]},
"project": {"id": metadata["project"]["projectId"]},
"availability_zone": availability_zone,
"region": availability_zone.rsplit("-", 1)[0],
"machine": {"type": metadata["instance"]["machineType"].split("/")[-1]},
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/cloud_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def request(self, *args, **kwargs):
assert metadata == {
"provider": "gcp",
"instance": {"id": "4306570268266786072", "name": "basepi-test"},
"project": {"id": "513326162531", "name": "elastic-apm"},
"project": {"id": "elastic-apm"},
"availability_zone": "us-west3-a",
"region": "us-west3",
"machine": {"type": "n1-standard-1"},
Expand Down

0 comments on commit 4d4be04

Please # to comment.