Skip to content

Commit 60cf3d6

Browse files
authored
Combine GCP resource detectors (#181)
* Delete individual classes for each GCP resource type * Combine all GCP resource detectors in a single class * Add missing javadoc * Fix Cloud Function detection * Rename GCPComputeResource to GCPResource * Fix GKE cluster location detection GKE resource should either only have the zone or the region as their location. Updated the source from where the location attribute is extracted. * Avoid adding malformed location to attributes in GKE
1 parent ba637f0 commit 60cf3d6

File tree

16 files changed

+572
-982
lines changed

16 files changed

+572
-982
lines changed

detectors/resources/src/main/java/com/google/cloud/opentelemetry/detectors/CloudRunResource.java

Lines changed: 0 additions & 75 deletions
This file was deleted.

detectors/resources/src/main/java/com/google/cloud/opentelemetry/detectors/GAEResource.java

Lines changed: 0 additions & 92 deletions
This file was deleted.

detectors/resources/src/main/java/com/google/cloud/opentelemetry/detectors/GCEResource.java

Lines changed: 0 additions & 78 deletions
This file was deleted.

detectors/resources/src/main/java/com/google/cloud/opentelemetry/detectors/GCFResource.java

Lines changed: 0 additions & 76 deletions
This file was deleted.

detectors/resources/src/main/java/com/google/cloud/opentelemetry/detectors/GCPMetadataConfig.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ String getClusterName() {
9393
return getAttribute("instance/attributes/cluster-name");
9494
}
9595

96+
// Returns null on failure to retrieve from metadata server
97+
String getClusterLocation() {
98+
return getAttribute("instance/attributes/cluster-location");
99+
}
100+
96101
// Returns null on failure to retrieve from metadata server
97102
String getInstanceHostName() {
98103
return getAttribute("instance/hostname");

0 commit comments

Comments
 (0)