diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 16c9c335e1..94044ca7c9 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -31,21 +31,22 @@ Use subheadings with the "=====" level for adding notes for unreleased changes: === Unreleased -[float] -===== Bug fixes -* Prevent bad serialization in edge cases for span compression - {pull}3293[#3293] -* Allow overriding of transaction type for Servlet-API transactions - {pull}3226[#3226] -* Fix micrometer histogram serialization - {pull}3290[#3290], {pull}3304[#3304] -* Fix transactions not being correctly handled in certain edge cases - {pull}3294[#3294] - [float] ===== Features * Add support for Elasticsearch client 8.9 - {pull}3283[#3283] * Added `baggage_to_attach` config option to allow automatic lifting of baggage into transaction, span and error attributes - {pull}3288[#3288], {pull}3289[#3289] * Exclude elasticsearch 8.10 and newer clients from instrumentation because they natively support OpenTelemetry - {pull}3303[#3303] * Switched to OpenTelemetry compatible context propagation for Kafka - {pull}3300[#3300] +* Changed `cloud.project.id` collected in Google Cloud (GCP) to be the `project-id` - {issues}3311[#3311] * Allow running the IntelliJ debug agent in parallel - {pull}3315[#3315] +[float] +===== Bug fixes +* Prevent bad serialization in edge cases for span compression - {pull}3293[#3293] +* Allow overriding of transaction type for Servlet-API transactions - {pull}3226[#3226] +* Fix micrometer histogram serialization - {pull}3290[#3290], {pull}3304[#3304] +* Fix transactions not being correctly handled in certain edge cases - {pull}3294[#3294] + [[release-notes-1.x]] === Java Agent version 1.x diff --git a/apm-agent-core/src/main/java/co/elastic/apm/agent/impl/metadata/CloudMetadataProvider.java b/apm-agent-core/src/main/java/co/elastic/apm/agent/impl/metadata/CloudMetadataProvider.java index cf2f39cab8..caa060f0b7 100644 --- a/apm-agent-core/src/main/java/co/elastic/apm/agent/impl/metadata/CloudMetadataProvider.java +++ b/apm-agent-core/src/main/java/co/elastic/apm/agent/impl/metadata/CloudMetadataProvider.java @@ -343,8 +343,7 @@ static CloudProviderInfo deserializeGcpMetadata(@Nullable String rawMetadata) th if (projectData instanceof Map) { @SuppressWarnings("unchecked") Map projectMap = (Map) projectData; String projectId = projectMap.get("projectId") instanceof String ? (String) projectMap.get("projectId") : null; - Long numericProjectId = projectMap.get("numericProjectId") instanceof Long ? (Long) projectMap.get("numericProjectId") : null; - cloudProviderInfo.setProject(new NameAndIdField(projectId, numericProjectId)); + cloudProviderInfo.setProject(new NameAndIdField(null, projectId)); } else { logger.warn("Error while parsing GCP metadata - expecting the value of the 'project' entry to be a map but it is not"); } diff --git a/apm-agent-core/src/test/java/co/elastic/apm/agent/impl/metadata/CloudMetadataProviderTest.java b/apm-agent-core/src/test/java/co/elastic/apm/agent/impl/metadata/CloudMetadataProviderTest.java index b2cd9c2399..90894e2fca 100644 --- a/apm-agent-core/src/test/java/co/elastic/apm/agent/impl/metadata/CloudMetadataProviderTest.java +++ b/apm-agent-core/src/test/java/co/elastic/apm/agent/impl/metadata/CloudMetadataProviderTest.java @@ -41,8 +41,8 @@ void gcpMetadataDeserializeTest() throws IOException { assertThat(gcpMetadata.getInstance().getId()).isEqualTo("4306570268266786072"); assertThat(gcpMetadata.getInstance().getName()).isEqualTo("basepi-test"); assertThat(gcpMetadata.getAccount()).isNull(); - assertThat(gcpMetadata.getProject().getId()).isEqualTo("513326162531"); - assertThat(gcpMetadata.getProject().getName()).isEqualTo("elastic-apm"); + assertThat(gcpMetadata.getProject().getId()).isEqualTo("elastic-apm"); + assertThat(gcpMetadata.getProject().getName()).isNull(); assertThat(gcpMetadata.getMachine().getType()).isEqualTo("n1-standard-1"); }