Skip to content

Conversation

@ektabj
Copy link
Contributor

@ektabj ektabj commented Sep 9, 2024

Issue description:

In this PR:

  • Supports remoteResourceType and remoteResourceIdentifier filter when fetching from Logs.
  • Migrating MySQL to 8.4.
  • Updated trace template.

E2E test after updating trace template:


E2E test failed run reproduced locally - https://github.com/ektabj/aws-application-signals-test-framework/actions/runs/10771640665/job/29867588349
E2E test run passed after changes: https://github.com/ektabj/aws-application-signals-test-framework/actions/runs/10777657675/job/29887245097

Issue description:

When we assert RemoteResourceType and RemoteResourceIdentifier attributes in EMF logs, we are using Logs filter: RemoteService and RemoteOperation filter to fetch logs. However, it's not guaranteed that EMF log with RemoteService and RemoteOperation attributes will have RemoteResourceType and RemoteResourceIdentifier. The logs fetched with this generic filter might get more logs than expected and only asserting the first log event in the result.

Description of changes:

This change enhances the log filter by appending && ($.RemoteResourceType = %EXAMPLE%) && ($.RemoteResourceIdentifier = %EXAMPLE%) to the filter if they present in the template to get more specific log events.

Log Filter doc: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html#regex-expressions

Log Filter used before this change (From E2E testing log):

2024-07-02T13:41:46.9400277Z 13:41:46.840 [main] INFO  com.amazon.aoc.validators.CWLogValidator - Filter Pattern for Log Search: { ($.Service = sample-application-eu-west-1-9762031914-112) && ($.Operation = "GET /aws-sdk-call") && ($.RemoteService = "AWS::S3") && ($.RemoteOperation = "GetBucketLocation") }

Log Filter used after this change (From E2E testing log):

2024-07-02T13:49:00.6162597Z 13:49:00.510 [main] INFO  com.amazon.aoc.validators.CWLogValidator - Filter Pattern for Log Search: { ($.Service = sample-application-eu-west-1-9762033464-113) && ($.Operation = "GET /aws-sdk-call") && ($.RemoteService = "AWS::S3") && ($.RemoteOperation = "GetBucketLocation") && ($.RemoteResourceType = %^AWS::S3::Bucket$%) && ($.RemoteResourceIdentifier = %^e2e-test-bucket-name-eu-west-1-9762033464-113$%) }

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@jerry-shao
Copy link
Contributor

LGTM

@majanjua-amzn majanjua-amzn merged commit 3502e73 into aws-observability:main Sep 11, 2024
1 check passed
jerry-shao added a commit to jerry-shao/aws-application-signals-test-framework that referenced this pull request Sep 12, 2024
jerry-shao pushed a commit to jerry-shao/aws-application-signals-test-framework that referenced this pull request Sep 23, 2024
jerry-shao pushed a commit to jerry-shao/aws-application-signals-test-framework that referenced this pull request Sep 23, 2024
@jerry-shao jerry-shao mentioned this pull request Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants