diff --git a/test/app_signals/resources/config.json b/test/app_signals/resources/config.json index 9c03d5915..2a275eb83 100644 --- a/test/app_signals/resources/config.json +++ b/test/app_signals/resources/config.json @@ -4,7 +4,50 @@ }, "logs": { "metrics_collected": { - "app_signals": {} + "app_signals": { + "rules":[ + { + "selectors":[ + { + "dimension":"Operation", + "match":"operation" + } + ], + "action":"keep", + "rule_name":"keep01" + }, + { + "selectors":[ + { + "dimension":"Service", + "match":"drop-service-name*" + } + ], + "action":"drop", + "rule_name":"drop01" + }, + { + "selectors":[ + { + "dimension":"Operation", + "match":"operation" + }, + { + "dimension":"Service", + "match":"service-name" + } + ], + "replacements":[ + { + "target_dimension":"Operation", + "value":"replaced-operation" + } + ], + "action":"replace", + "rule_name":"replace01" + } + ] + } } }, "traces": { diff --git a/test/app_signals/resources/metrics/server_consumer.json b/test/app_signals/resources/metrics/server_consumer.json index 6748e6fd0..2d3cd0b79 100644 --- a/test/app_signals/resources/metrics/server_consumer.json +++ b/test/app_signals/resources/metrics/server_consumer.json @@ -68,8 +68,7 @@ "value": { "stringValue": "pod-name" } - } - , + }, { "key": "K8s.Node", "value": { @@ -128,8 +127,7 @@ "value": { "stringValue": "pod-name" } - } - , + }, { "key": "K8s.Node", "value": { @@ -210,6 +208,124 @@ } ] } + }, + { + "name": "Latency", + "unit": "Milliseconds", + "sum": { + "dataPoints": [ + { + "attributes": [ + { + "key": "aws.span.kind", + "value": { + "stringValue": "SERVER" + } + }, + { + "key": "Operation", + "value": { + "stringValue": "operation" + } + }, + { + "key": "Service", + "value": { + "stringValue": "drop-service-name-1" + } + }, + { + "key": "K8s.Namespace", + "value": { + "stringValue": "default" + } + }, + { + "key": "K8s.Pod", + "value": { + "stringValue": "pod-name" + } + }, + { + "key": "K8s.Node", + "value": { + "stringValue": "i-00000000000000000" + } + }, + { + "key": "K8s.Workload", + "value": { + "stringValue": "sample-app" + } + } + ], + "startTimeUnixNano": START_TIME, + "timeUnixNano": START_TIME, + "sum": 1, + "min": 1, + "max": 1 + } + ] + } + }, + { + "name": "Latency", + "unit": "Milliseconds", + "sum": { + "dataPoints": [ + { + "attributes": [ + { + "key": "aws.span.kind", + "value": { + "stringValue": "SERVER" + } + }, + { + "key": "Operation", + "value": { + "stringValue": "do-not-keep-operation-1" + } + }, + { + "key": "Service", + "value": { + "stringValue": "service-name" + } + }, + { + "key": "K8s.Namespace", + "value": { + "stringValue": "default" + } + }, + { + "key": "K8s.Pod", + "value": { + "stringValue": "pod-name" + } + }, + { + "key": "K8s.Node", + "value": { + "stringValue": "i-00000000000000000" + } + }, + { + "key": "K8s.Workload", + "value": { + "stringValue": "sample-app" + } + } + ], + "startTimeUnixNano": START_TIME, + "timeUnixNano": START_TIME, + "sum": 1, + "min": 1, + "max": 1 + } + ] + } } ] } diff --git a/test/app_signals/traces_test.go b/test/app_signals/traces_test.go index fe84a2b0f..6f7471e05 100644 --- a/test/app_signals/traces_test.go +++ b/test/app_signals/traces_test.go @@ -25,7 +25,7 @@ var annotations = map[string]interface{}{ "aws_local_service": "service-name", "aws_remote_service": "service-name-remote", "HostedIn_K8s_Namespace": "default", - "aws_local_operation": "operation", + "aws_local_operation": "replaced-operation", } type AppSignalsTracesRunner struct { diff --git a/test/metric/app_signals_util.go b/test/metric/app_signals_util.go index 781209ab8..f4deafd3b 100644 --- a/test/metric/app_signals_util.go +++ b/test/metric/app_signals_util.go @@ -34,7 +34,7 @@ var ( }, { Key: "Operation", - Value: dimension.ExpectedDimensionValue{Value: aws.String("operation")}, + Value: dimension.ExpectedDimensionValue{Value: aws.String("replaced-operation")}, }, } @@ -57,7 +57,7 @@ var ( }, { Key: "Operation", - Value: dimension.ExpectedDimensionValue{Value: aws.String("operation")}, + Value: dimension.ExpectedDimensionValue{Value: aws.String("replaced-operation")}, }, { Key: "RemoteOperation",