-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor platform detection to enhance testing
- Loading branch information
Showing
19 changed files
with
577 additions
and
436 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
...sources-support/src/main/java/com/google/cloud/opentelemetry/detectors/AttributeKeys.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package com.google.cloud.opentelemetry.detectors; | ||
|
||
public final class AttributeKeys { | ||
// GCE Attributes | ||
public static final String GCE_PROJECT_ID = AttributeKeys.PROJECT_ID; | ||
public static final String GCE_AVAILABILITY_ZONE = AttributeKeys.AVAILABILITY_ZONE; | ||
public static final String GCE_CLOUD_REGION = AttributeKeys.CLOUD_REGION; | ||
public static final String GCE_INSTANCE_ID = AttributeKeys.INSTANCE_ID; | ||
public static final String GCE_INSTANCE_NAME = AttributeKeys.INSTANCE_NAME; | ||
public static final String GCE_MACHINE_TYPE = AttributeKeys.MACHINE_TYPE; | ||
|
||
// GKE Attributes | ||
public static final String GKE_POD_NAME = "gke_pod_name"; | ||
public static final String GKE_NAMESPACE = "gke_namespace"; | ||
public static final String GKE_CONTAINER_NAME = "gke_container_name"; | ||
public static final String GKE_CLUSTER_NAME = "gke_cluster_name"; | ||
public static final String GKE_CLUSTER_LOCATION_TYPE = "gke_cluster_location_type"; | ||
public static final String GKE_CLUSTER_LOCATION = "gke_cluster_location"; | ||
public static final String GKE_HOST_ID = AttributeKeys.INSTANCE_ID; | ||
|
||
// GKE Location Constants | ||
public static final String GKE_LOCATION_TYPE_ZONE = "ZONE"; | ||
public static final String GKE_LOCATION_TYPE_REGION = "REGION"; | ||
|
||
// GAE Attributes | ||
public static final String GAE_MODULE_NAME = "gae_module_name"; | ||
public static final String GAE_APP_VERSION = "gae_app_version"; | ||
public static final String GAE_INSTANCE_ID = AttributeKeys.INSTANCE_ID; | ||
public static final String GAE_AVAILABILITY_ZONE = AttributeKeys.AVAILABILITY_ZONE; | ||
public static final String GAE_CLOUD_REGION = AttributeKeys.CLOUD_REGION; | ||
|
||
// Google Serverless Compute Attributes | ||
public static final String SERVERLESS_COMPUTE_NAME = "serverless_compute_name"; | ||
public static final String SERVERLESS_COMPUTE_REVISION = "serverless_compute_revision"; | ||
public static final String SERVERLESS_COMPUTE_AVAILABILITY_ZONE = AttributeKeys.AVAILABILITY_ZONE; | ||
public static final String SERVERLESS_COMPUTE_CLOUD_REGION = AttributeKeys.CLOUD_REGION; | ||
public static final String SERVERLESS_COMPUTE_INSTANCE_ID = AttributeKeys.INSTANCE_ID; | ||
|
||
static final String PROJECT_ID = "project_id"; | ||
static final String AVAILABILITY_ZONE = "availability_zone"; | ||
static final String CLOUD_REGION = "cloud_region"; | ||
static final String INSTANCE_ID = "instance_id"; | ||
static final String INSTANCE_NAME = "instance_name"; | ||
static final String MACHINE_TYPE = "machine_type"; | ||
} |
15 changes: 0 additions & 15 deletions
15
...ces-support/src/main/java/com/google/cloud/opentelemetry/detectors/CloudLocationUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
...rces-support/src/main/java/com/google/cloud/opentelemetry/detectors/DetectedPlatform.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.google.cloud.opentelemetry.detectors; | ||
|
||
import java.util.Map; | ||
import java.util.Optional; | ||
|
||
public interface DetectedPlatform { | ||
GCPPlatformDetector.SupportedPlatform getSupportedPlatform(); | ||
|
||
Map<String, Optional<String>> getAttributes(); | ||
} |
15 changes: 0 additions & 15 deletions
15
...-support/src/main/java/com/google/cloud/opentelemetry/detectors/EnvironmentVariables.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 0 additions & 61 deletions
61
...resources-support/src/main/java/com/google/cloud/opentelemetry/detectors/GAEDetector.java
This file was deleted.
Oops, something went wrong.
57 changes: 0 additions & 57 deletions
57
...resources-support/src/main/java/com/google/cloud/opentelemetry/detectors/GCEDetector.java
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
...ces-support/src/main/java/com/google/cloud/opentelemetry/detectors/GCPMetadataConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.