Skip to content

Commit

Permalink
feat: Adding E2E log test for RDS database interations (#104)
Browse files Browse the repository at this point in the history
This change introduces the expected EMF log templates and asserts them after calling `/mysql` API.
  • Loading branch information
jerry-shao authored Jul 29, 2024
1 parent 0737925 commit 1308ba3
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/java-eks-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ jobs:
--platform-info ${{ env.CLUSTER_NAME }}
--service-name sample-application-${{ env.TESTING_ID }}
--remote-service-deployment-name ${{ env.REMOTE_SERVICE_DEPLOYMENT_NAME }}
--remote-resource-identifier "information_schema|${{env.RDS_MYSQL_CLUSTER_ENDPOINT}}|3306"
--query-string ip=${{ env.REMOTE_SERVICE_POD_IP }}&testingId=${{ env.TESTING_ID }}
--rollup'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public enum PredefinedExpectedTemplate implements FileConfig {
JAVA_EKS_CLIENT_CALL_METRIC("/expected-data-template/java/eks/client-call-metric.mustache"),
JAVA_EKS_CLIENT_CALL_TRACE("/expected-data-template/java/eks/client-call-trace.mustache"),

JAVA_EKS_RDS_MYSQL_LOG("/expected-data-template/java/eks/rds-mysql-log.mustache"),
JAVA_EKS_RDS_MYSQL_METRIC("/expected-data-template/java/eks/rds-mysql-metric.mustache"),

/** Java EC2 Default Test Case Validations */
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[{
"EC2.AutoScalingGroup": "^eks-.+",
"EC2.InstanceId": "^i-[A-Za-z0-9]{17}$",
"EKS.Cluster": "^{{platformInfo}}$",
"Environment": "^eks:{{platformInfo}}/{{appNamespace}}$",
"K8s.Namespace": "^{{appNamespace}}$",
"K8s.Node": "^i-[A-Za-z0-9]{17}$",
"K8s.Pod": "^sample-app-deployment-{{testingId}}(-[A-Za-z0-9]*)*$",
"K8s.Workload": "^sample-app-deployment-{{testingId}}$",
"PlatformType": "^AWS::EKS$",
"Service": "^{{serviceName}}$",
"Operation": "GET /mysql",
"Version": "^1$",
"Telemetry.Source": "^LocalRootSpan$",
"Host": "^ip(-[0-9]{1,3}){4}.*$"
},
{
"EC2.AutoScalingGroup": "^eks-.+",
"EC2.InstanceId": "^i-[A-Za-z0-9]{17}$",
"EKS.Cluster": "^{{platformInfo}}$",
"Environment": "^eks:{{platformInfo}}/{{appNamespace}}$",
"K8s.Namespace": "^{{appNamespace}}$",
"K8s.Node": "^i-[A-Za-z0-9]{17}$",
"K8s.Pod": "^sample-app-deployment-{{testingId}}(-[A-Za-z0-9]*)*$",
"K8s.Workload": "^sample-app-deployment-{{testingId}}$",
"PlatformType": "^AWS::EKS$",
"Service": "^{{serviceName}}$",
"Operation": "GET /mysql",
"Version": "^1$",
"Telemetry.Source": "^ClientSpan$",
"Host": "^ip(-[0-9]{1,3}){4}.*$",
"RemoteService": "mysql",
"RemoteOperation": "SELECT",
"RemoteResourceType": "DB::Connection",
"RemoteResourceIdentifier": "^{{remoteResourceIdentifier}}$"
}]
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,10 @@
httpPath: "/client-call"
httpMethod: "get"
callingType: "http"
expectedLogStructureTemplate: "JAVA_EKS_CLIENT_CALL_LOG"
expectedLogStructureTemplate: "JAVA_EKS_CLIENT_CALL_LOG"
-
validationType: "cw-log"
httpPath: "/mysql"
httpMethod: "get"
callingType: "http"
expectedLogStructureTemplate: "JAVA_EKS_RDS_MYSQL_LOG"

0 comments on commit 1308ba3

Please sign in to comment.