Skip to content

Commit 930e8dc

Browse files
authored
changes to metadata.cloud.project.* fields collected for GCP (#1901)
1 parent c2f8763 commit 930e8dc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

elasticapm/utils/cloud.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def gcp_metadata():
114114
return {
115115
"provider": "gcp",
116116
"instance": {"id": str(metadata["instance"]["id"]), "name": metadata["instance"]["name"]},
117-
"project": {"id": str(metadata["project"]["numericProjectId"]), "name": metadata["project"]["projectId"]},
117+
"project": {"id": metadata["project"]["projectId"]},
118118
"availability_zone": availability_zone,
119119
"region": availability_zone.rsplit("-", 1)[0],
120120
"machine": {"type": metadata["instance"]["machineType"].split("/")[-1]},

tests/utils/cloud_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def request(self, *args, **kwargs):
108108
assert metadata == {
109109
"provider": "gcp",
110110
"instance": {"id": "4306570268266786072", "name": "basepi-test"},
111-
"project": {"id": "513326162531", "name": "elastic-apm"},
111+
"project": {"id": "elastic-apm"},
112112
"availability_zone": "us-west3-a",
113113
"region": "us-west3",
114114
"machine": {"type": "n1-standard-1"},

0 commit comments

Comments
 (0)