View a markdown version of this page

Monitor with CloudWatch Logs Insights - Distributed Load Testing on AWS

Monitor with CloudWatch Logs Insights

This solution deploys four CloudWatch Logs Insights saved queries that appear in the CloudWatch Logs Insights console under Saved queries. These queries provide visibility into test orchestration, errors, task failures, and orphan cleanup without requiring you to write custom queries.

Each query name includes the stack name and Region for identification across multiple deployments. For example: DLT - Test Timeline [my-stack us-east-1].

Using saved queries

To run a saved query:

  1. Open the CloudWatch Logs Insights console.

  2. In the left panel, expand Saved queries.

  3. Select a query prefixed with DLT -.

  4. If the query contains a placeholder value such as REPLACE_WITH_TEST_RUN_ID, replace it with the actual test run ID from your test results.

  5. Choose Run query.

DLT - Test Timeline

Shows the full lifecycle for a single test run across all orchestration Lambda functions. Use this query to trace the sequence of events from test creation through completion.

Attribute Value

Fields

@timestamp, logEvent, message, region, error

Filter

testRunId = "REPLACE_WITH_TEST_RUN_ID"

Sort

@timestamp asc

Limit

500

Replace REPLACE_WITH_TEST_RUN_ID with the test run ID you want to investigate.

DLT - Test Errors

Shows all ERROR-level entries for a single test run across Lambda functions and ECS tasks. Use this query to identify the root cause when a test fails or produces unexpected results.

Attribute Value

Fields

@timestamp, logEvent, message, region, taskId, error

Filter

testRunId = "REPLACE_WITH_TEST_RUN_ID" and level = "ERROR"

Sort

@timestamp asc

Replace REPLACE_WITH_TEST_RUN_ID with the test run ID you want to investigate.

DLT - Task Failures

Shows individual ECS task failures with stop codes and failure classification. Use this query to understand why specific Fargate tasks stopped during a test.

Attribute Value

Fields

@timestamp, testId, testRunId, region, taskArn, stopCode, exitCode, stopCategory, stoppedReason

Filter

logEvent = "TASK_FAILURE_DETECTED"

Sort

@timestamp desc

Limit

50

This query does not require a test run ID — it shows all recent task failures across all test runs.

DLT - Orphan Cleanup

Shows the history of orphaned ECS service detection. Use this query to verify that the hourly orphan cleanup process is finding and removing abandoned services.

Attribute Value

Fields

@timestamp, logEvent, message, region, cluster, orphanCount, orphanTestIds

Filter

logEvent = "ORPHAN_DETECTED"

Sort

@timestamp desc

Limit

50