Skip to content

Commit

Permalink
update github workflows for new test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
jj22ee committed Apr 23, 2024
1 parent 61245b3 commit 64850f1
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 22 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/appsignals-e2e-ec2-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@ jobs:
- name: Call all test APIs
continue-on-error: true
run: |
curl -S -s http://${{ env.MAIN_SERVICE_ENDPOINT }}/outgoing-http-call/
curl -S -s http://${{ env.MAIN_SERVICE_ENDPOINT }}/aws-sdk-call/
curl -S -s http://${{ env.MAIN_SERVICE_ENDPOINT }}/remote-service?ip=${{ env.REMOTE_SERVICE_IP }}/
curl -S -s http://${{ env.MAIN_SERVICE_ENDPOINT }}/client-call/
curl -S -s http://${{ env.MAIN_SERVICE_ENDPOINT }}/outgoing-http-call
curl -S -s http://${{ env.MAIN_SERVICE_ENDPOINT }}/aws-sdk-call?testingId=${{ env.TESTING_ID }}
curl -S -s http://${{ env.MAIN_SERVICE_ENDPOINT }}/remote-service?ip=${{ env.REMOTE_SERVICE_IP }}
curl -S -s http://${{ env.MAIN_SERVICE_ENDPOINT }}/client-call
- name: Initiate Gradlew Daemon
uses: ./.github/workflows/actions/execute_and_retry
Expand Down Expand Up @@ -208,7 +208,7 @@ jobs:
--log-group ${{ env.LOG_GROUP_NAME }}
--service-name sample-application-${{ env.TESTING_ID }}
--remote-service-name sample-remote-application-${{ env.TESTING_ID }}
--request-body ip=${{ env.REMOTE_SERVICE_IP }}
--request-body ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }}
--instance-ami ${{ env.EC2_INSTANCE_AMI }}
--rollup'

Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/appsignals-e2e-eks-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
test-cluster-name:
required: true
type: string
appsignals-adot-image-name:
application-signals-adot-image:
required: false
type: string
caller-workflow-name:
Expand Down Expand Up @@ -260,10 +260,10 @@ jobs:
- name: Call all test APIs
continue-on-error: true
run: |
curl -S -s http://${{ env.APP_ENDPOINT }}/outgoing-http-call/
curl -S -s http://${{ env.APP_ENDPOINT }}/aws-sdk-call/
curl -S -s http://${{ env.APP_ENDPOINT }}/remote-service?ip=${{ env.REMOTE_SERVICE_POD_IP }}/
curl -S -s http://${{ env.APP_ENDPOINT }}/client-call/
curl -S -s http://${{ env.APP_ENDPOINT }}/outgoing-http-call
curl -S -s http://${{ env.APP_ENDPOINT }}/aws-sdk-call?testingId=${{ env.TESTING_ID }}
curl -S -s http://${{ env.APP_ENDPOINT }}/remote-service?ip=${{ env.REMOTE_SERVICE_POD_IP }}
curl -S -s http://${{ env.APP_ENDPOINT }}/client-call
- name: Initiate Gradlew Daemon
uses: ./.github/workflows/actions/execute_and_retry
Expand Down Expand Up @@ -306,7 +306,7 @@ jobs:
--service-name sample-application-${{ env.TESTING_ID }}
--remote-service-name sample-remote-application-${{ env.TESTING_ID }}
--remote-service-deployment-name ${{ env.REMOTE_SERVICE_DEPLOYMENT_NAME }}
--request-body ip=${{ env.REMOTE_SERVICE_POD_IP }}
--request-body ip=${{ env.REMOTE_SERVICE_POD_IP }}&testingId=${{ env.TESTING_ID }}
--rollup'

- name: Call endpoints and validate generated traces
Expand Down
2 changes: 1 addition & 1 deletion terraform/ec2/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ resource "null_resource" "remote_service_setup" {
"echo $agent_config > amazon-cloudwatch-agent.json",

# Get and run CW agent rpm
"${var.get_cw_agent_rpm_command}",
"${var.get_cw_agent_rpm_command}",
"sudo rpm -U ./cw-agent.rpm",
"sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -s -c file:./amazon-cloudwatch-agent.json",

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

@Log4j2
public class CWMetricValidator implements IValidator {
private static int DEFAULT_MAX_RETRY_COUNT = 10;
private static int DEFAULT_MAX_RETRY_COUNT = 80;

private MustacheHelper mustacheHelper = new MustacheHelper();
private ICaller caller;
Expand Down Expand Up @@ -92,8 +92,8 @@ public void validate() throws Exception {
RetryHelper.retry(
maxRetryCount,
() -> {
// We will query both the Service and RemoteService dimensions to ensure we get all
// metrics from all aggregations, specifically the [RemoteService] aggregation.
// We will query metrics with specific [Service], [RemoteService], or [RemoteService, RemoteTarget] dimension
// values to ensure we get all metrics from all aggregations, specifically the [RemoteService] aggregation.
List<String> serviceNames =
Lists.newArrayList(
context.getServiceName(), context.getRemoteServiceDeploymentName());
Expand All @@ -106,26 +106,28 @@ public void validate() throws Exception {

List<Metric> actualMetricList = Lists.newArrayList();

// Add sets of dimesion filters to use for each query to CloudWatch
// Add sets of dimesion filters to use for each query to CloudWatch.
List<List<Pair<String, String>>> dimensionLists = Lists.newArrayList();
// Query metrics for rolled up into the [serviceDimension] dimension
// Query metrics that includes any of these <service> values.
for (String serviceName : serviceNames) {
dimensionLists.add(
Arrays.asList(new Pair<>(CloudWatchService.SERVICE_DIMENSION, serviceName)));
}
// Query metrics for rolled up into the [remoteServiceDimension] dimension
// Query metrics that includes any of these <remoteService> values.
for (String remoteServiceName : remoteServiceNames) {
dimensionLists.add(
Arrays.asList(
new Pair<>(CloudWatchService.REMOTE_SERVICE_DIMENSION, remoteServiceName)));
}
// Query metrics for rolled up into the [remoteServiceDimension, remoteTargetDemsion] dimensions
// Query for metrics that includes both of these <remoteService, remoteTarget> values.
// Querying just 'remoteService="AWS.SDK.S3"' would also work, but that will result in
// returning too many canary metrics and may cause issues.
dimensionLists.add(
Arrays.asList(
new Pair<>(CloudWatchService.REMOTE_SERVICE_DIMENSION, "AWS.SDK.S3"),
new Pair<>(CloudWatchService.REMOTE_TARGET_DIMENSION, context.getRemoteTargetName())));

// Populate actualMetricList with metrics that pass through one of the dimension filters
// Populate actualMetricList with metrics that pass through at least one of the dimension filters
for (List<Pair<String, String>> dimensionList : dimensionLists) {
addMetrics(dimensionList, expectedMetricList, actualMetricList);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ private Context initContext() {
context.setServiceName(SERVICE_NAME);
context.setRemoteServiceName(REMOTE_SERVICE_NAME);
context.setRemoteServiceDeploymentName(REMOTE_SERVICE_DEPLOYMENT_NAME);
context.setRemoteTargetName(REMOTE_TARGET_NAME);
return context;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@
value: AWS.SDK.S3
-
name: RemoteTarget
value: e2e-test-bucket-name
value: remoteTargetName
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
value: AWS.SDK.S3
-
name: RemoteTarget
value: e2e-test-bucket-name
value: remoteTargetName

0 comments on commit 64850f1

Please sign in to comment.