in detectors/resources-support/src/main/java/com/google/cloud/opentelemetry/detection/GoogleKubernetesEngine.java [47:59]
private String getClusterLocationType() {
String clusterLocation = this.metadataConfig.getClusterLocation();
long dashCount =
(clusterLocation == null || clusterLocation.isEmpty())
? 0
: clusterLocation.chars().filter(ch -> ch == '-').count();
if (dashCount == 1) {
return GKE_LOCATION_TYPE_REGION;
} else if (dashCount == 2) {
return GKE_LOCATION_TYPE_ZONE;
}
return "";
}