From f0b6d7c24b801b434d00bf72c980267d71442dd0 Mon Sep 17 00:00:00 2001 From: Pooja Reddy Nathala Date: Wed, 25 Oct 2023 14:32:43 -0400 Subject: [PATCH] traces changes cluster annotation --- test/apm/traces_test.go | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/test/apm/traces_test.go b/test/apm/traces_test.go index cb2d545d1..5dc284530 100644 --- a/test/apm/traces_test.go +++ b/test/apm/traces_test.go @@ -18,24 +18,23 @@ import ( ) const ( - lookbackDuration = time.Duration(-80) * time.Minute - EKSClusterAnnotation = "EKS_Cluster" + lookbackDuration = time.Duration(-80) * time.Minute + EKSClusterAnnotation = "HostedIn_EKS_Cluster" ) - -var annotations = map[string]string { - "aws_remote_target": "remote-target", +var annotations = map[string]string{ + "aws_remote_target": "remote-target", "aws_remote_operation": "remote-operation", - "aws_local_service": "service-name", - "aws_remote_service": "service-name-remote", - "K8s_Namespace": "default", - "aws_local_operation": "operation", + "aws_local_service": "service-name", + "aws_remote_service": "service-name-remote", + "K8s_Namespace": "default", + "aws_local_operation": "operation", } type APMTracesRunner struct { test_runner.BaseTestRunner - testName string - clusterName string + testName string + clusterName string } func (t *APMTracesRunner) Validate() status.TestGroupResult { @@ -44,10 +43,10 @@ func (t *APMTracesRunner) Validate() status.TestGroupResult { Status: status.FAILED, }} timeNow := time.Now() - + fmt.Printf("CLuster name: %v\n", t.clusterName) annotations[EKSClusterAnnotation] = t.clusterName xrayFilter := FilterExpression(annotations) - traceIds, err := GetTraceIDs(timeNow.Add(lookbackDuration),timeNow, xrayFilter) + traceIds, err := GetTraceIDs(timeNow.Add(lookbackDuration), timeNow, xrayFilter) if err != nil { fmt.Printf("error getting trace ids: %v", err) } else { @@ -103,6 +102,7 @@ func FilterExpression(annotations map[string]string) string { expression += " AND " } expression += fmt.Sprintf("annotation.%s = %s", key, result) + fmt.Printf("annotation.%s = %s", key, result) } return expression }