diff --git a/shared/resourcemapping/src/main/java/com/google/cloud/opentelemetry/resource/ResourceTranslator.java b/shared/resourcemapping/src/main/java/com/google/cloud/opentelemetry/resource/ResourceTranslator.java index f1e84ec6..e891637c 100644 --- a/shared/resourcemapping/src/main/java/com/google/cloud/opentelemetry/resource/ResourceTranslator.java +++ b/shared/resourcemapping/src/main/java/com/google/cloud/opentelemetry/resource/ResourceTranslator.java @@ -172,7 +172,7 @@ public static AttributeMapping create( public static GcpResource mapResource(Resource resource) { String platform = resource.getAttribute(ResourceAttributes.CLOUD_PLATFORM); if (platform == null) { - return genericTaskOrNode(resource); + return mapK8sResourceOrGenericTaskOrNode(resource); } switch (platform) { case ResourceAttributes.CloudPlatformValues.GCP_COMPUTE_ENGINE: @@ -182,21 +182,25 @@ public static GcpResource mapResource(Resource resource) { case ResourceAttributes.CloudPlatformValues.GCP_APP_ENGINE: return mapBase(resource, "gae_instance", GOOGLE_CLOUD_APP_ENGINE_INSTANCE_LABELS); default: - // if k8s.cluster.name is set, pattern match for various k8s resources. - // this will also match non-cloud k8s platforms like minikube. - if (resource.getAttribute(ResourceAttributes.K8S_CLUSTER_NAME) != null) { - if (resource.getAttribute(ResourceAttributes.K8S_CONTAINER_NAME) != null) { - return mapBase(resource, "k8s_container", K8S_CONTAINER_LABELS); - } else if (resource.getAttribute(ResourceAttributes.K8S_POD_NAME) != null) { - return mapBase(resource, "k8s_pod", K8S_POD_LABELS); - } else if (resource.getAttribute(ResourceAttributes.K8S_NODE_NAME) != null) { - return mapBase(resource, "k8s_node", K8S_NODE_LABELS); - } else { - return mapBase(resource, "k8s_cluster", K8S_CLUSTER_LABELS); - } - } - return genericTaskOrNode(resource); + return mapK8sResourceOrGenericTaskOrNode(resource); + } + } + + private static GcpResource mapK8sResourceOrGenericTaskOrNode(Resource resource) { + // if k8s.cluster.name is set, pattern match for various k8s resources. + // this will also match non-cloud k8s platforms like minikube. + if (resource.getAttribute(ResourceAttributes.K8S_CLUSTER_NAME) != null) { + if (resource.getAttribute(ResourceAttributes.K8S_CONTAINER_NAME) != null) { + return mapBase(resource, "k8s_container", K8S_CONTAINER_LABELS); + } else if (resource.getAttribute(ResourceAttributes.K8S_POD_NAME) != null) { + return mapBase(resource, "k8s_pod", K8S_POD_LABELS); + } else if (resource.getAttribute(ResourceAttributes.K8S_NODE_NAME) != null) { + return mapBase(resource, "k8s_node", K8S_NODE_LABELS); + } else { + return mapBase(resource, "k8s_cluster", K8S_CLUSTER_LABELS); + } } + return genericTaskOrNode(resource); } private static GcpResource genericTaskOrNode(Resource resource) { diff --git a/shared/resourcemapping/src/test/java/com/google/cloud/opentelemetry/resource/ResourceTranslatorTest.java b/shared/resourcemapping/src/test/java/com/google/cloud/opentelemetry/resource/ResourceTranslatorTest.java index 806e3407..95cd9efd 100644 --- a/shared/resourcemapping/src/test/java/com/google/cloud/opentelemetry/resource/ResourceTranslatorTest.java +++ b/shared/resourcemapping/src/test/java/com/google/cloud/opentelemetry/resource/ResourceTranslatorTest.java @@ -41,24 +41,8 @@ private static Arguments generateOTelResourceMappingTestArgs( private static Stream provideOTelResourceAttributesToMonitoredResourceMapping() { return Stream.of( - generateOTelResourceMappingTestArgs( - Map.ofEntries( - new SimpleEntry<>( - ResourceAttributes.CLOUD_PROVIDER, ResourceAttributes.CloudProviderValues.GCP), - new SimpleEntry<>( - ResourceAttributes.CLOUD_PLATFORM, - ResourceAttributes.CloudPlatformValues.GCP_COMPUTE_ENGINE), - new SimpleEntry<>(ResourceAttributes.CLOUD_ACCOUNT_ID, "GCE-pid"), - new SimpleEntry<>( - ResourceAttributes.CLOUD_AVAILABILITY_ZONE, "country-region-zone"), - new SimpleEntry<>(ResourceAttributes.CLOUD_REGION, "country-region"), - new SimpleEntry<>(ResourceAttributes.HOST_ID, "GCE-instance-id"), - new SimpleEntry<>(ResourceAttributes.HOST_NAME, "GCE-instance-name"), - new SimpleEntry<>(ResourceAttributes.HOST_TYPE, "GCE-instance-type")), - "gce_instance", - Map.ofEntries( - new SimpleEntry<>("instance_id", "GCE-instance-id"), - new SimpleEntry<>("zone", "country-region-zone"))), + // test cases for k8s + // test cases for k8s_container on [GCP, AWS, Azure, non-cloud] generateOTelResourceMappingTestArgs( Map.ofEntries( new SimpleEntry<>( @@ -87,35 +71,86 @@ private static Stream provideOTelResourceAttributesToMonitoredResourc generateOTelResourceMappingTestArgs( Map.ofEntries( new SimpleEntry<>( - ResourceAttributes.CLOUD_PROVIDER, ResourceAttributes.CloudProviderValues.GCP), + ResourceAttributes.CLOUD_PROVIDER, ResourceAttributes.CloudProviderValues.AWS), new SimpleEntry<>( ResourceAttributes.CLOUD_PLATFORM, ResourceAttributes.CloudPlatformValues.AWS_EKS), new SimpleEntry<>( ResourceAttributes.CLOUD_AVAILABILITY_ZONE, "country-region-zone"), - new SimpleEntry<>(ResourceAttributes.K8S_CLUSTER_NAME, "EKS-cluster-name")), - "k8s_cluster", + new SimpleEntry<>(ResourceAttributes.K8S_CLUSTER_NAME, "EKS-cluster-name"), + new SimpleEntry<>(ResourceAttributes.K8S_NAMESPACE_NAME, "EKS-namespace-name"), + new SimpleEntry<>(ResourceAttributes.K8S_POD_NAME, "EKS-pod-name"), + new SimpleEntry<>(ResourceAttributes.K8S_CONTAINER_NAME, "EKS-container-name")), + "k8s_container", Map.ofEntries( new SimpleEntry<>("cluster_name", "EKS-cluster-name"), + new SimpleEntry<>("namespace_name", "EKS-namespace-name"), + new SimpleEntry<>("pod_name", "EKS-pod-name"), + new SimpleEntry<>("container_name", "EKS-container-name"), new SimpleEntry<>("location", "country-region-zone"))), generateOTelResourceMappingTestArgs( Map.ofEntries( new SimpleEntry<>( - ResourceAttributes.CLOUD_PROVIDER, ResourceAttributes.CloudProviderValues.GCP), + ResourceAttributes.CLOUD_PROVIDER, + ResourceAttributes.CloudProviderValues.AZURE), new SimpleEntry<>( ResourceAttributes.CLOUD_PLATFORM, ResourceAttributes.CloudPlatformValues.AZURE_AKS), new SimpleEntry<>( ResourceAttributes.CLOUD_AVAILABILITY_ZONE, "country-region-zone"), - new SimpleEntry<>(ResourceAttributes.K8S_CLUSTER_NAME, "AKS-cluster-name")), - "k8s_cluster", + new SimpleEntry<>(ResourceAttributes.K8S_CLUSTER_NAME, "AKS-cluster-name"), + new SimpleEntry<>(ResourceAttributes.K8S_NAMESPACE_NAME, "AKS-namespace-name"), + new SimpleEntry<>(ResourceAttributes.K8S_POD_NAME, "AKS-pod-name"), + new SimpleEntry<>(ResourceAttributes.K8S_CONTAINER_NAME, "AKS-container-name")), + "k8s_container", Map.ofEntries( new SimpleEntry<>("cluster_name", "AKS-cluster-name"), + new SimpleEntry<>("namespace_name", "AKS-namespace-name"), + new SimpleEntry<>("pod_name", "AKS-pod-name"), + new SimpleEntry<>("container_name", "AKS-container-name"), + new SimpleEntry<>("location", "country-region-zone"))), + generateOTelResourceMappingTestArgs( + Map.ofEntries( + new SimpleEntry<>( + ResourceAttributes.CLOUD_AVAILABILITY_ZONE, "country-region-zone"), + new SimpleEntry<>(ResourceAttributes.K8S_CLUSTER_NAME, "non-cloud-cluster-name"), + new SimpleEntry<>( + ResourceAttributes.K8S_NAMESPACE_NAME, "non-cloud-namespace-name"), + new SimpleEntry<>(ResourceAttributes.K8S_POD_NAME, "non-cloud-pod-name"), + new SimpleEntry<>( + ResourceAttributes.K8S_CONTAINER_NAME, "non-cloud-container-name")), + "k8s_container", + Map.ofEntries( + new SimpleEntry<>("cluster_name", "non-cloud-cluster-name"), + new SimpleEntry<>("namespace_name", "non-cloud-namespace-name"), + new SimpleEntry<>("pod_name", "non-cloud-pod-name"), + new SimpleEntry<>("container_name", "non-cloud-container-name"), new SimpleEntry<>("location", "country-region-zone"))), + // test cases for k8s_pod on [GCP, AWS, Azure, non-cloud] generateOTelResourceMappingTestArgs( Map.ofEntries( new SimpleEntry<>( ResourceAttributes.CLOUD_PROVIDER, ResourceAttributes.CloudProviderValues.GCP), + new SimpleEntry<>( + ResourceAttributes.CLOUD_PLATFORM, + ResourceAttributes.CloudPlatformValues.GCP_KUBERNETES_ENGINE), + new SimpleEntry<>(ResourceAttributes.CLOUD_ACCOUNT_ID, "GCE-pid"), + new SimpleEntry<>( + ResourceAttributes.CLOUD_AVAILABILITY_ZONE, "country-region-zone"), + new SimpleEntry<>(ResourceAttributes.CLOUD_REGION, "country-region"), + new SimpleEntry<>(ResourceAttributes.K8S_CLUSTER_NAME, "GKE-cluster-name"), + new SimpleEntry<>(ResourceAttributes.K8S_NAMESPACE_NAME, "GKE-testNameSpace"), + new SimpleEntry<>(ResourceAttributes.K8S_POD_NAME, "GKE-testHostName")), + "k8s_pod", + Map.ofEntries( + new SimpleEntry<>("location", "country-region-zone"), + new SimpleEntry<>("cluster_name", "GKE-cluster-name"), + new SimpleEntry<>("namespace_name", "GKE-testNameSpace"), + new SimpleEntry<>("pod_name", "GKE-testHostName"))), + generateOTelResourceMappingTestArgs( + Map.ofEntries( + new SimpleEntry<>( + ResourceAttributes.CLOUD_PROVIDER, ResourceAttributes.CloudProviderValues.AWS), new SimpleEntry<>( ResourceAttributes.CLOUD_PLATFORM, ResourceAttributes.CloudPlatformValues.AWS_EKS), @@ -133,7 +168,8 @@ private static Stream provideOTelResourceAttributesToMonitoredResourc generateOTelResourceMappingTestArgs( Map.ofEntries( new SimpleEntry<>( - ResourceAttributes.CLOUD_PROVIDER, ResourceAttributes.CloudProviderValues.GCP), + ResourceAttributes.CLOUD_PROVIDER, + ResourceAttributes.CloudProviderValues.AZURE), new SimpleEntry<>( ResourceAttributes.CLOUD_PLATFORM, ResourceAttributes.CloudPlatformValues.AZURE_AKS), @@ -148,10 +184,43 @@ private static Stream provideOTelResourceAttributesToMonitoredResourc new SimpleEntry<>("pod_name", "AKS-pod-name"), new SimpleEntry<>("namespace_name", "AKS-namespace-name"), new SimpleEntry<>("location", "country-region-zone"))), + generateOTelResourceMappingTestArgs( + Map.ofEntries( + new SimpleEntry<>( + ResourceAttributes.CLOUD_AVAILABILITY_ZONE, "country-region-zone"), + new SimpleEntry<>(ResourceAttributes.K8S_CLUSTER_NAME, "non-cloud-cluster-name"), + new SimpleEntry<>( + ResourceAttributes.K8S_NAMESPACE_NAME, "non-cloud-namespace-name"), + new SimpleEntry<>(ResourceAttributes.K8S_POD_NAME, "non-cloud-pod-name")), + "k8s_pod", + Map.ofEntries( + new SimpleEntry<>("cluster_name", "non-cloud-cluster-name"), + new SimpleEntry<>("pod_name", "non-cloud-pod-name"), + new SimpleEntry<>("namespace_name", "non-cloud-namespace-name"), + new SimpleEntry<>("location", "country-region-zone"))), + // test cases for k8s_node on [GCP, AWS, Azure, non-cloud] generateOTelResourceMappingTestArgs( Map.ofEntries( new SimpleEntry<>( ResourceAttributes.CLOUD_PROVIDER, ResourceAttributes.CloudProviderValues.GCP), + new SimpleEntry<>( + ResourceAttributes.CLOUD_PLATFORM, + ResourceAttributes.CloudPlatformValues.GCP_KUBERNETES_ENGINE), + new SimpleEntry<>(ResourceAttributes.CLOUD_ACCOUNT_ID, "GCE-pid"), + new SimpleEntry<>( + ResourceAttributes.CLOUD_AVAILABILITY_ZONE, "country-region-zone"), + new SimpleEntry<>(ResourceAttributes.CLOUD_REGION, "country-region"), + new SimpleEntry<>(ResourceAttributes.K8S_CLUSTER_NAME, "GKE-cluster-name"), + new SimpleEntry<>(ResourceAttributes.K8S_NODE_NAME, "GKE-node-name")), + "k8s_node", + Map.ofEntries( + new SimpleEntry<>("location", "country-region-zone"), + new SimpleEntry<>("node_name", "GKE-node-name"), + new SimpleEntry<>("cluster_name", "GKE-cluster-name"))), + generateOTelResourceMappingTestArgs( + Map.ofEntries( + new SimpleEntry<>( + ResourceAttributes.CLOUD_PROVIDER, ResourceAttributes.CloudProviderValues.AWS), new SimpleEntry<>( ResourceAttributes.CLOUD_PLATFORM, ResourceAttributes.CloudPlatformValues.AWS_EKS), @@ -167,7 +236,8 @@ private static Stream provideOTelResourceAttributesToMonitoredResourc generateOTelResourceMappingTestArgs( Map.ofEntries( new SimpleEntry<>( - ResourceAttributes.CLOUD_PROVIDER, ResourceAttributes.CloudProviderValues.GCP), + ResourceAttributes.CLOUD_PROVIDER, + ResourceAttributes.CloudProviderValues.AZURE), new SimpleEntry<>( ResourceAttributes.CLOUD_PLATFORM, ResourceAttributes.CloudPlatformValues.AZURE_AKS), @@ -182,119 +252,94 @@ private static Stream provideOTelResourceAttributesToMonitoredResourc new SimpleEntry<>("location", "country-region-zone"))), generateOTelResourceMappingTestArgs( Map.ofEntries( - new SimpleEntry<>( - ResourceAttributes.CLOUD_PROVIDER, ResourceAttributes.CloudProviderValues.GCP), - new SimpleEntry<>( - ResourceAttributes.CLOUD_PLATFORM, - ResourceAttributes.CloudPlatformValues.AWS_EKS), new SimpleEntry<>( ResourceAttributes.CLOUD_AVAILABILITY_ZONE, "country-region-zone"), - new SimpleEntry<>(ResourceAttributes.K8S_CLUSTER_NAME, "EKS-cluster-name"), - new SimpleEntry<>(ResourceAttributes.K8S_NAMESPACE_NAME, "EKS-namespace-name"), - new SimpleEntry<>(ResourceAttributes.K8S_POD_NAME, "EKS-pod-name"), - new SimpleEntry<>(ResourceAttributes.K8S_CONTAINER_NAME, "EKS-container-name")), - "k8s_container", + new SimpleEntry<>(ResourceAttributes.K8S_CLUSTER_NAME, "non-cloud-cluster-name"), + new SimpleEntry<>(ResourceAttributes.K8S_NODE_NAME, "non-cloud-node-name")), + "k8s_node", Map.ofEntries( - new SimpleEntry<>("cluster_name", "EKS-cluster-name"), - new SimpleEntry<>("namespace_name", "EKS-namespace-name"), - new SimpleEntry<>("pod_name", "EKS-pod-name"), - new SimpleEntry<>("container_name", "EKS-container-name"), + new SimpleEntry<>("cluster_name", "non-cloud-cluster-name"), + new SimpleEntry<>("node_name", "non-cloud-node-name"), new SimpleEntry<>("location", "country-region-zone"))), + // test cases for k8s_cluster on [GCP, AWS, Azure, non-cloud] generateOTelResourceMappingTestArgs( Map.ofEntries( new SimpleEntry<>( ResourceAttributes.CLOUD_PROVIDER, ResourceAttributes.CloudProviderValues.GCP), new SimpleEntry<>( ResourceAttributes.CLOUD_PLATFORM, - ResourceAttributes.CloudPlatformValues.AZURE_AKS), + ResourceAttributes.CloudPlatformValues.GCP_KUBERNETES_ENGINE), + new SimpleEntry<>(ResourceAttributes.CLOUD_ACCOUNT_ID, "GCE-pid"), new SimpleEntry<>( ResourceAttributes.CLOUD_AVAILABILITY_ZONE, "country-region-zone"), - new SimpleEntry<>(ResourceAttributes.K8S_CLUSTER_NAME, "AKS-cluster-name"), - new SimpleEntry<>(ResourceAttributes.K8S_NAMESPACE_NAME, "AKS-namespace-name"), - new SimpleEntry<>(ResourceAttributes.K8S_POD_NAME, "AKS-pod-name"), - new SimpleEntry<>(ResourceAttributes.K8S_CONTAINER_NAME, "AKS-container-name")), - "k8s_container", + new SimpleEntry<>(ResourceAttributes.CLOUD_REGION, "country-region"), + new SimpleEntry<>(ResourceAttributes.K8S_CLUSTER_NAME, "GKE-cluster-name")), + "k8s_cluster", Map.ofEntries( - new SimpleEntry<>("cluster_name", "AKS-cluster-name"), - new SimpleEntry<>("namespace_name", "AKS-namespace-name"), - new SimpleEntry<>("pod_name", "AKS-pod-name"), - new SimpleEntry<>("container_name", "AKS-container-name"), - new SimpleEntry<>("location", "country-region-zone"))), + new SimpleEntry<>("location", "country-region-zone"), + new SimpleEntry<>("cluster_name", "GKE-cluster-name"))), generateOTelResourceMappingTestArgs( Map.ofEntries( new SimpleEntry<>( - ResourceAttributes.CLOUD_PROVIDER, ResourceAttributes.CloudProviderValues.GCP), + ResourceAttributes.CLOUD_PROVIDER, ResourceAttributes.CloudProviderValues.AWS), new SimpleEntry<>( ResourceAttributes.CLOUD_PLATFORM, ResourceAttributes.CloudPlatformValues.AWS_EKS), new SimpleEntry<>( ResourceAttributes.CLOUD_AVAILABILITY_ZONE, "country-region-zone"), - new SimpleEntry<>(ResourceAttributes.K8S_CLUSTER_NAME, "non-cloud-cluster-name")), + new SimpleEntry<>(ResourceAttributes.K8S_CLUSTER_NAME, "EKS-cluster-name")), "k8s_cluster", Map.ofEntries( - new SimpleEntry<>("cluster_name", "non-cloud-cluster-name"), + new SimpleEntry<>("cluster_name", "EKS-cluster-name"), new SimpleEntry<>("location", "country-region-zone"))), generateOTelResourceMappingTestArgs( Map.ofEntries( new SimpleEntry<>( - ResourceAttributes.CLOUD_PROVIDER, ResourceAttributes.CloudProviderValues.GCP), + ResourceAttributes.CLOUD_PROVIDER, + ResourceAttributes.CloudProviderValues.AZURE), new SimpleEntry<>( ResourceAttributes.CLOUD_PLATFORM, - ResourceAttributes.CloudPlatformValues.AWS_EKS), + ResourceAttributes.CloudPlatformValues.AZURE_AKS), new SimpleEntry<>( ResourceAttributes.CLOUD_AVAILABILITY_ZONE, "country-region-zone"), - new SimpleEntry<>(ResourceAttributes.K8S_CLUSTER_NAME, "non-cloud-cluster-name"), - new SimpleEntry<>( - ResourceAttributes.K8S_NAMESPACE_NAME, "non-cloud-namespace-name"), - new SimpleEntry<>(ResourceAttributes.K8S_POD_NAME, "non-cloud-pod-name")), - "k8s_pod", + new SimpleEntry<>(ResourceAttributes.K8S_CLUSTER_NAME, "AKS-cluster-name")), + "k8s_cluster", Map.ofEntries( - new SimpleEntry<>("cluster_name", "non-cloud-cluster-name"), - new SimpleEntry<>("pod_name", "non-cloud-pod-name"), - new SimpleEntry<>("namespace_name", "non-cloud-namespace-name"), + new SimpleEntry<>("cluster_name", "AKS-cluster-name"), new SimpleEntry<>("location", "country-region-zone"))), generateOTelResourceMappingTestArgs( Map.ofEntries( - new SimpleEntry<>( - ResourceAttributes.CLOUD_PROVIDER, ResourceAttributes.CloudProviderValues.GCP), - new SimpleEntry<>( - ResourceAttributes.CLOUD_PLATFORM, - ResourceAttributes.CloudPlatformValues.AZURE_AKS), new SimpleEntry<>( ResourceAttributes.CLOUD_AVAILABILITY_ZONE, "country-region-zone"), - new SimpleEntry<>(ResourceAttributes.K8S_CLUSTER_NAME, "non-cloud-cluster-name"), - new SimpleEntry<>(ResourceAttributes.K8S_NODE_NAME, "non-cloud-node-name")), - "k8s_node", + new SimpleEntry<>(ResourceAttributes.K8S_CLUSTER_NAME, "non-cloud-cluster-name")), + "k8s_cluster", Map.ofEntries( new SimpleEntry<>("cluster_name", "non-cloud-cluster-name"), - new SimpleEntry<>("node_name", "non-cloud-node-name"), new SimpleEntry<>("location", "country-region-zone"))), + // test case for GCE Instance generateOTelResourceMappingTestArgs( Map.ofEntries( new SimpleEntry<>( ResourceAttributes.CLOUD_PROVIDER, ResourceAttributes.CloudProviderValues.GCP), new SimpleEntry<>( ResourceAttributes.CLOUD_PLATFORM, - ResourceAttributes.CloudPlatformValues.AZURE_AKS), + ResourceAttributes.CloudPlatformValues.GCP_COMPUTE_ENGINE), + new SimpleEntry<>(ResourceAttributes.CLOUD_ACCOUNT_ID, "GCE-pid"), new SimpleEntry<>( ResourceAttributes.CLOUD_AVAILABILITY_ZONE, "country-region-zone"), - new SimpleEntry<>(ResourceAttributes.K8S_CLUSTER_NAME, "non-cloud-cluster-name"), - new SimpleEntry<>( - ResourceAttributes.K8S_NAMESPACE_NAME, "non-cloud-namespace-name"), - new SimpleEntry<>(ResourceAttributes.K8S_POD_NAME, "non-cloud-pod-name"), - new SimpleEntry<>( - ResourceAttributes.K8S_CONTAINER_NAME, "non-cloud-container-name")), - "k8s_container", + new SimpleEntry<>(ResourceAttributes.CLOUD_REGION, "country-region"), + new SimpleEntry<>(ResourceAttributes.HOST_ID, "GCE-instance-id"), + new SimpleEntry<>(ResourceAttributes.HOST_NAME, "GCE-instance-name"), + new SimpleEntry<>(ResourceAttributes.HOST_TYPE, "GCE-instance-type")), + "gce_instance", Map.ofEntries( - new SimpleEntry<>("cluster_name", "non-cloud-cluster-name"), - new SimpleEntry<>("namespace_name", "non-cloud-namespace-name"), - new SimpleEntry<>("pod_name", "non-cloud-pod-name"), - new SimpleEntry<>("container_name", "non-cloud-container-name"), - new SimpleEntry<>("location", "country-region-zone"))), + new SimpleEntry<>("instance_id", "GCE-instance-id"), + new SimpleEntry<>("zone", "country-region-zone"))), + // test case for EC2 Instance generateOTelResourceMappingTestArgs( Map.ofEntries( new SimpleEntry<>( - ResourceAttributes.CLOUD_PROVIDER, ResourceAttributes.CloudProviderValues.GCP), + ResourceAttributes.CLOUD_PROVIDER, ResourceAttributes.CloudProviderValues.AWS), new SimpleEntry<>( ResourceAttributes.CLOUD_PLATFORM, ResourceAttributes.CloudPlatformValues.AWS_EC2), @@ -308,6 +353,7 @@ private static Stream provideOTelResourceAttributesToMonitoredResourc new SimpleEntry<>("region", "country-region-zone"), new SimpleEntry<>("instance_id", "aws-instance-id"), new SimpleEntry<>("aws_account", "aws-id"))), + // test cases for generic_task generateOTelResourceMappingTestArgs( Map.ofEntries( new SimpleEntry<>(ResourceAttributes.SERVICE_NAME, "my-service-prevailed"), @@ -354,6 +400,7 @@ private static Stream provideOTelResourceAttributesToMonitoredResourc new SimpleEntry<>("namespace", "prod"), new SimpleEntry<>("task_id", "1234"), new SimpleEntry<>("location", "global"))), + // test cases for generic_node generateOTelResourceMappingTestArgs( Map.ofEntries( new SimpleEntry<>(ResourceAttributes.SERVICE_NAME, "unknown_service"),