Skip to content

Commit

Permalink
Make AttributeMappings final (#347)
Browse files Browse the repository at this point in the history
  • Loading branch information
psx95 authored May 22, 2024
1 parent 78c5cd4 commit 13696be
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
/** Translates from OpenTelemetry Resource into Google Cloud's notion of resource. */
public class ResourceTranslator {

private static String UNKNOWN_SERVICE_PREFIX = "unknown_service";
private static final String UNKNOWN_SERVICE_PREFIX = "unknown_service";

private ResourceTranslator() {}

Expand Down Expand Up @@ -89,11 +89,11 @@ public static AttributeMapping create(
}
}

private static List<AttributeMapping> GCE_INSTANCE_LABELS =
private static final List<AttributeMapping> GCE_INSTANCE_LABELS =
Arrays.asList(
AttributeMapping.create("zone", ResourceAttributes.CLOUD_AVAILABILITY_ZONE),
AttributeMapping.create("instance_id", ResourceAttributes.HOST_ID));
private static List<AttributeMapping> K8S_CONTAINER_LABELS =
private static final List<AttributeMapping> K8S_CONTAINER_LABELS =
Arrays.asList(
AttributeMapping.create(
"location",
Expand All @@ -103,7 +103,7 @@ public static AttributeMapping create(
AttributeMapping.create("namespace_name", ResourceAttributes.K8S_NAMESPACE_NAME),
AttributeMapping.create("container_name", ResourceAttributes.K8S_CONTAINER_NAME),
AttributeMapping.create("pod_name", ResourceAttributes.K8S_POD_NAME));
private static List<AttributeMapping> K8S_POD_LABELS =
private static final List<AttributeMapping> K8S_POD_LABELS =
Arrays.asList(
AttributeMapping.create(
"location",
Expand All @@ -112,33 +112,33 @@ public static AttributeMapping create(
AttributeMapping.create("cluster_name", ResourceAttributes.K8S_CLUSTER_NAME),
AttributeMapping.create("namespace_name", ResourceAttributes.K8S_NAMESPACE_NAME),
AttributeMapping.create("pod_name", ResourceAttributes.K8S_POD_NAME));
private static List<AttributeMapping> K8S_NODE_LABELS =
private static final List<AttributeMapping> K8S_NODE_LABELS =
Arrays.asList(
AttributeMapping.create(
"location",
Arrays.asList(
ResourceAttributes.CLOUD_AVAILABILITY_ZONE, ResourceAttributes.CLOUD_REGION)),
AttributeMapping.create("cluster_name", ResourceAttributes.K8S_CLUSTER_NAME),
AttributeMapping.create("node_name", ResourceAttributes.K8S_NODE_NAME));
private static List<AttributeMapping> K8S_CLUSTER_LABELS =
private static final List<AttributeMapping> K8S_CLUSTER_LABELS =
Arrays.asList(
AttributeMapping.create(
"location",
Arrays.asList(
ResourceAttributes.CLOUD_AVAILABILITY_ZONE, ResourceAttributes.CLOUD_REGION)),
AttributeMapping.create("cluster_name", ResourceAttributes.K8S_CLUSTER_NAME));
private static List<AttributeMapping> AWS_EC2_INSTANCE_LABELS =
private static final List<AttributeMapping> AWS_EC2_INSTANCE_LABELS =
Arrays.asList(
AttributeMapping.create("instance_id", ResourceAttributes.HOST_ID),
AttributeMapping.create("region", ResourceAttributes.CLOUD_AVAILABILITY_ZONE),
AttributeMapping.create("aws_account", ResourceAttributes.CLOUD_ACCOUNT_ID));
private static List<AttributeMapping> GOOGLE_CLOUD_APP_ENGINE_INSTANCE_LABELS =
private static final List<AttributeMapping> GOOGLE_CLOUD_APP_ENGINE_INSTANCE_LABELS =
Arrays.asList(
AttributeMapping.create("module_id", ResourceAttributes.FAAS_NAME),
AttributeMapping.create("version_id", ResourceAttributes.FAAS_VERSION),
AttributeMapping.create("instance_id", ResourceAttributes.FAAS_INSTANCE),
AttributeMapping.create("location", ResourceAttributes.CLOUD_REGION));
private static List<AttributeMapping> GENERIC_TASK_LABELS =
private static final List<AttributeMapping> GENERIC_TASK_LABELS =
Arrays.asList(
AttributeMapping.create(
"location",
Expand All @@ -155,7 +155,7 @@ public static AttributeMapping create(
Arrays.asList(
ResourceAttributes.SERVICE_INSTANCE_ID, ResourceAttributes.FAAS_INSTANCE),
""));
private static List<AttributeMapping> GENERIC_NODE_LABELS =
private static final List<AttributeMapping> GENERIC_NODE_LABELS =
Arrays.asList(
AttributeMapping.create(
"location",
Expand Down

0 comments on commit 13696be

Please sign in to comment.