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

Change 'cloud.project.id' for GCP metadata to be the 'project-id' #3316

Merged
merged 2 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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]
JonasKunz marked this conversation as resolved.
Show resolved Hide resolved
* 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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,7 @@ static CloudProviderInfo deserializeGcpMetadata(@Nullable String rawMetadata) th
if (projectData instanceof Map) {
@SuppressWarnings("unchecked") Map<String, Object> projectMap = (Map<String, Object>) 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");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

Expand Down
Loading