Skip to content
Open
Show file tree
Hide file tree
Changes from 67 commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
f02dcb3
Create test.yml
Miqueasher Oct 7, 2025
383791c
updating custom metrics test branch
Miqueasher Oct 7, 2025
c74f03f
Merge branch 'otel-custom-metrics-test' of https://github.com/aws-obs…
Miqueasher Oct 7, 2025
d89c43b
Update test.yml
Miqueasher Oct 7, 2025
3e1be9b
fixing variables.tf typo
Miqueasher Oct 7, 2025
f5b6b0e
Merge branch 'otel-custom-metrics-test' of https://github.com/aws-obs…
Miqueasher Oct 7, 2025
c5f28fd
updated bash syntax error
Miqueasher Oct 7, 2025
3455277
updating tf files
Miqueasher Oct 7, 2025
ddd2993
updating syntax error
Miqueasher Oct 7, 2025
446bd08
updating main service to connect to local host only if CM is enabled
Miqueasher Oct 7, 2025
75c47a2
updating main.tf
Miqueasher Oct 7, 2025
0c75867
updating default instance
Miqueasher Oct 7, 2025
e285993
setting custom metrics default to true
Miqueasher Oct 7, 2025
dd9e778
fixing cw agent
Miqueasher Oct 8, 2025
a3fedbc
making custom metrics conditional
Miqueasher Oct 8, 2025
81500c6
setting custom metrics to false
Miqueasher Oct 8, 2025
72c88c5
separating metric validation files
Miqueasher Oct 8, 2025
b0e450f
Revert "separating metric validation files"
Miqueasher Oct 8, 2025
0e3aff2
adding debugger for sql pws
Miqueasher Oct 8, 2025
d070aab
adding dummy MYSQL data to prevent KeyError
Miqueasher Oct 8, 2025
67329dc
setting custom metrics to true
Miqueasher Oct 8, 2025
59b9f12
updating zip,validation templates, variables, and test region
Miqueasher Oct 9, 2025
284c65e
fixing typo
Miqueasher Oct 9, 2025
761a7ed
updating otlp-proto dependency version
Miqueasher Oct 9, 2025
02e58d5
updating grpc dependency and sample app
Miqueasher Oct 9, 2025
bc4a37a
fixing typo in main.tf
Miqueasher Oct 9, 2025
f3dbdf4
testing new grpc/http endpoints
Miqueasher Oct 9, 2025
3807ca9
updating cwa
Miqueasher Oct 9, 2025
2883c2f
removing cwagent and updated views
Miqueasher Oct 9, 2025
c826fa0
updating env variables
Miqueasher Oct 9, 2025
791c366
updating cloudwatch config
Miqueasher Oct 9, 2025
3c2cbe1
adding metrics section to test metrics pipeline
Miqueasher Oct 10, 2025
b8cb6c5
updating views and cwa
Miqueasher Oct 10, 2025
9cfa435
removing global variable
Miqueasher Oct 10, 2025
f616720
changing global variable to http to test exporter
Miqueasher Oct 10, 2025
b4356ba
adding gauge/histogram and modifying export structure
Miqueasher Oct 10, 2025
801286c
updating views, metric-val, and default test
Miqueasher Oct 13, 2025
50d9ebd
removing broken gauge, fixing typo
Miqueasher Oct 14, 2025
a9e2feb
updating predefined template and metric validation name to standards
Miqueasher Oct 14, 2025
92e8620
reverting back to last passing commit
Miqueasher Oct 14, 2025
effd5d6
adding telemetry.status to resource
Miqueasher Oct 14, 2025
ce893f2
updating namespace
Miqueasher Oct 14, 2025
c3b25d0
removing custom export pipeline
Miqueasher Oct 14, 2025
f83f427
updating views
Miqueasher Oct 14, 2025
79f9a09
updating traffic generator to hit custom endpoints
Miqueasher Oct 14, 2025
29c32d6
updating according to public docs.
Miqueasher Oct 14, 2025
7153eaf
testing new cwa config
Miqueasher Oct 14, 2025
1c5f429
reverting cwagent and adding logging to metric validator
Miqueasher Oct 14, 2025
710b4c3
adding more log debuggers
Miqueasher Oct 14, 2025
0a29d7e
adjusting otlp metrics end point for test
Miqueasher Oct 15, 2025
e2e01a8
making grpc unecrypted
Miqueasher Oct 15, 2025
5d84db6
Revert "making grpc unecrypted"
Miqueasher Oct 15, 2025
9a649bc
attempt to revert back to test id-18514948781-1549-2067
Miqueasher Oct 15, 2025
a4ba51d
adding validator for CWAgent
Miqueasher Oct 15, 2025
dd6c12c
testing out single validator file
Miqueasher Oct 15, 2025
f0f890d
reverting back to separate validation files
Miqueasher Oct 16, 2025
b6bab9e
updating dimension value of custom_export_counter
Miqueasher Oct 16, 2025
34087f4
updating validation dimensions
Miqueasher Oct 16, 2025
1f74499
adding debug loggers
Miqueasher Oct 16, 2025
db6fda5
updating validation template
Miqueasher Oct 16, 2025
ea96f6e
updating service.name attribute to Service
Miqueasher Oct 16, 2025
f360d97
updating service.name attribute to Service
Miqueasher Oct 16, 2025
523e41b
updating val templates with temp values for testing
Miqueasher Oct 16, 2025
9149f84
removing debuggers/loggers
Miqueasher Oct 16, 2025
567e84c
removing dead code
Miqueasher Oct 16, 2025
fc77459
deleting 'delete-me' file and removing test.yml file
Miqueasher Oct 16, 2025
e3034a5
Merge branch 'main' into otel-custom-metrics-test
Miqueasher Oct 16, 2025
3359c0b
adding in test files, and testing PR changes
Miqueasher Oct 16, 2025
2883bbe
adding in test files, and testing PR changes
Miqueasher Oct 17, 2025
b1b9e7a
testing region changes
Miqueasher Oct 17, 2025
e458468
swapping region to us-west-2
Miqueasher Oct 17, 2025
0de1b5a
Merge branch 'otel-custom-metrics-test' of https://github.com/Miqueas…
Miqueasher Oct 17, 2025
6e55891
Revert " adding in test files, and testing PR changes"
Miqueasher Oct 17, 2025
c840ace
adding in test files, and testing PR changes
Miqueasher Oct 17, 2025
f6b3b67
resolving merge conflicts
Miqueasher Oct 17, 2025
3d7b835
updated test region
Miqueasher Oct 17, 2025
ee3b357
updating validator run path
Miqueasher Oct 17, 2025
5fe3e7a
moved custom-metric-validation file location
Miqueasher Oct 17, 2025
3985b9b
removing test file and deleting delete-me files
Miqueasher Oct 20, 2025
12f6e21
updating sdk.version
Miqueasher Oct 20, 2025
a2c4041
updating sdk.version
Miqueasher Oct 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/dotnet-ec2-adot-sigv4-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ permissions:
contents: read

env:
E2E_TEST_AWS_REGION: 'us-west-2'
E2E_TEST_AWS_REGION: 'us-east-1'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't change stuff for unrelated files

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be updated in the next push

E2E_TEST_ACCOUNT_ID: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ACCOUNT_ID }}
E2E_TEST_ROLE_NAME: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }}
DOTNET_VERSION: ${{ inputs.dotnet-version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/java-ec2-adaptive-sampling-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ permissions:
contents: read

env:
E2E_TEST_AWS_REGION: us-west-2
E2E_TEST_AWS_REGION: us-east-1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be updated in the next push

CALLER_WORKFLOW_NAME: ${{ inputs.caller-workflow-name }}
SAMPLE_APP_FRONTEND_SERVICE_JAR: s3://aws-appsignals-sample-app-prod-us-west-2-adap/java-main-service-v11.jar
SAMPLE_APP_REMOTE_SERVICE_JAR: s3://aws-appsignals-sample-app-prod-us-west-2-adap/java-remote-service-v11.jar
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/java-ec2-adot-sigv4-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ permissions:
contents: read

env:
E2E_TEST_AWS_REGION: 'us-west-2' # Test uses us-west-2 in the us-east-1 accoun
E2E_TEST_AWS_REGION: 'us-east-1' # Test uses us-east-1 in the us-east-1 account
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be updated in the next push

CALLER_WORKFLOW_NAME: ${{ inputs.caller-workflow-name }}
METRIC_NAMESPACE: ApplicationSignals
JAVA_VERSION: ${{ inputs.java-version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/node-ec2-adot-sigv4-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ permissions:
contents: read

env:
E2E_TEST_AWS_REGION: 'us-west-2'
E2E_TEST_AWS_REGION: 'us-east-1'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be updated in the next push

CALLER_WORKFLOW_NAME: ${{ inputs.caller-workflow-name }}
NODE_VERSION: ${{ inputs.node-version }}
CPU_ARCHITECTURE: ${{ inputs.cpu-architecture }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-ec2-adot-sigv4-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ permissions:
contents: read

env:
E2E_TEST_AWS_REGION: 'us-west-2'
E2E_TEST_AWS_REGION: 'us-east-1'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be updated in the next push

CALLER_WORKFLOW_NAME: ${{ inputs.caller-workflow-name }}
PYTHON_VERSION: ${{ inputs.python-version }}
CPU_ARCHITECTURE: ${{ inputs.cpu-architecture }}
Expand Down
28 changes: 25 additions & 3 deletions .github/workflows/python-ec2-default-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ on:
required: false
type: string
default: 'github'
custom-metrics-enabled:
required: false
type: boolean
default: false
outputs:
job-started:
value: ${{ jobs.python-ec2-default.outputs.job-started }}
Expand All @@ -49,6 +53,7 @@ env:
CPU_ARCHITECTURE: ${{ inputs.cpu-architecture }}
ADOT_WHEEL_NAME: ${{ inputs.staging-wheel-name }}
OTEL_SOURCE: ${{ inputs.otel-source }}
CUSTOM_METRICS_ENABLED: ${{ inputs.custom-metrics-enabled }}
SAMPLE_APP_ZIP: s3://aws-appsignals-sample-app-prod-${{ inputs.aws-region }}/python-sample-app.zip
E2E_TEST_ACCOUNT_ID: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ACCOUNT_ID }}
E2E_TEST_ROLE_NAME: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }}
Expand Down Expand Up @@ -171,7 +176,7 @@ jobs:
-var="get_adot_wheel_command=${{ env.GET_ADOT_WHEEL_COMMAND }}" \
-var="language_version=${{ env.PYTHON_VERSION }}" \
-var="cpu_architecture=${{ env.CPU_ARCHITECTURE }}" \
|| deployment_failed=$?
-var="custom_metrics_enabled=${{ env.CUSTOM_METRICS_ENABLED }}" \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep the old line too

Suggested change
-var="custom_metrics_enabled=${{ env.CUSTOM_METRICS_ENABLED }}" \
-var="custom_metrics_enabled=${{ env.CUSTOM_METRICS_ENABLED }}" \
|| deployment_failed=$?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be updated in the next push


if [ $deployment_failed -eq 1 ]; then
echo "Terraform deployment was unsuccessful. Will attempt to retry deployment."
Expand Down Expand Up @@ -252,9 +257,26 @@ jobs:
--instance-id ${{ env.MAIN_SERVICE_INSTANCE_ID }}
--rollup'

- name: Validate CWAgent metrics
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This name doesn't really tell me what we're validating, are we validating custom metrics? If so, we should update the if: line to check whether CUSTOM_METRICS_ENABLED is true

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be updated in the next push

id: cwagent-metric-validation
if: (success() || steps.log-validation.outcome == 'failure') && !cancelled()
run: ./gradlew validator:run --args='-c python/ec2/default/custom-metric-validation.yml
--testing-id ${{ env.TESTING_ID }}
--endpoint http://${{ env.MAIN_SERVICE_ENDPOINT }}
--remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8001
--region ${{ env.E2E_TEST_AWS_REGION }}
--metric-namespace CWAgent
--log-group ${{ env.LOG_GROUP_NAME }}
--service-name python-sample-application-${{ env.TESTING_ID }}
--remote-service-name python-sample-remote-application-${{ env.TESTING_ID }}
--query-string ip=${{ env.REMOTE_SERVICE_IP }}
--instance-ami ${{ env.EC2_INSTANCE_AMI }}
--instance-id ${{ env.MAIN_SERVICE_INSTANCE_ID }}
--rollup'

- name: Validate generated traces
id: trace-validation
if: (success() || steps.log-validation.outcome == 'failure' || steps.metric-validation.outcome == 'failure') && !cancelled()
if: (success() || steps.log-validation.outcome == 'failure' || steps.metric-validation.outcome == 'failure' || steps.cwagent-metric-validation.outcome == 'failure') && !cancelled()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only check if that step passed if CUSTOM_METRICS_ENABLED is true

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be updated in the next push

run: ./gradlew validator:run --args='-c python/ec2/default/trace-validation.yml
--testing-id ${{ env.TESTING_ID }}
--endpoint http://${{ env.MAIN_SERVICE_ENDPOINT }}
Expand All @@ -281,7 +303,7 @@ jobs:
if: always()
id: validation-result
run: |
if [ "${{ steps.log-validation.outcome }}" = "success" ] && [ "${{ steps.metric-validation.outcome }}" = "success" ] && [ "${{ steps.trace-validation.outcome }}" = "success" ]; then
if [ "${{ steps.log-validation.outcome }}" = "success" ] && [ "${{ steps.cwagent-metric-validation.outcome }}" = "success" ] && [ "${{ steps.metric-validation.outcome }}" = "success" ] && [ "${{ steps.trace-validation.outcome }}" = "success" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be updated in the next push

echo "validation-result=success" >> $GITHUB_OUTPUT
else
echo "validation-result=failure" >> $GITHUB_OUTPUT
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-ec2-genesis-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ permissions:
contents: read

env:
E2E_TEST_AWS_REGION: 'us-west-2'
E2E_TEST_AWS_REGION: 'us-east-1'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be updated in the next push

E2E_TEST_ACCOUNT_ID: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ACCOUNT_ID }}
E2E_TEST_ROLE_NAME: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }}
ADOT_WHEEL_NAME: ${{ inputs.staging-wheel-name }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,22 @@
import base64
import threading
import time

import random
import boto3
import pymysql
import requests
import schedule
from django.http import HttpResponse, JsonResponse
from opentelemetry import trace
from opentelemetry import trace, metrics
from opentelemetry.trace.span import format_trace_id

logger = logging.getLogger(__name__)

#python equivalent of Meter meter = GlobalOpenTelemetry.getMeter("myMeter"); for custom metrics
meter = metrics.get_meter("myMeter")
custom_export_counter = meter.create_counter("custom_export_counter", unit="1", description="Custom export counter")
test_histogram = meter.create_histogram("test_histogram", description="Test histogram")

should_send_local_root_client_call = False
lock = threading.Lock()
def run_local_root_client_call_recurring_service():
Expand Down Expand Up @@ -50,6 +55,11 @@ def healthcheck(request):
return HttpResponse("healthcheck")

def aws_sdk_call(request):

# Increment counter/histogram
custom_export_counter.add(1, {"operation.type": "custom_export_1"})
test_histogram.record(random.randint(100, 1000), {"operation.type": "histogram"})

bucket_name = "e2e-test-bucket-name"

# Add a unique test ID to bucketname to associate buckets to specific test runs
Expand Down
4 changes: 2 additions & 2 deletions terraform/dotnet/lambda/lambda/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ variable "architecture" {

variable "region" {
type = string
description = "Lambda function running region, default value is us-west-2"
default = "us-west-2"
description = "Lambda function running region, default value is us-east-1"
default = "us-east-1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, going to stop commenting this on every instance of this issue

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be updated in the next push

}

variable "is_canary" {
Expand Down
4 changes: 2 additions & 2 deletions terraform/java/lambda/lambda/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ variable "architecture" {

variable "region" {
type = string
description = "Lambda function running region, default value is us-west-2"
default = "us-west-2"
description = "Lambda function running region, default value is us-east-1"
default = "us-east-1"
}

variable "is_canary" {
Expand Down
4 changes: 2 additions & 2 deletions terraform/node/lambda/lambda/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ variable "architecture" {

variable "region" {
type = string
description = "Lambda function running region, default value is us-west-2"
default = "us-west-2"
description = "Lambda function running region, default value is us-east-1"
default = "us-east-1"
}

variable "is_canary" {
Expand Down
2 changes: 1 addition & 1 deletion terraform/python/ec2/adot-genai/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# -------------------------------------------------------------------------

variable "aws_region" {
default = "us-west-2"
default = "us-east-1"
}

variable "test_id" {
Expand Down
10 changes: 5 additions & 5 deletions terraform/python/ec2/default/amazon-cloudwatch-agent.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"agent": {
"debug": true,
"region": "$REGION"
},
Comment on lines 2 to 5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this removed? Let's keep it in

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be updated in the next push

"traces": {
"traces_collected": {
"application_signals": {}
}
},
"logs": {
"metrics_collected": {
"application_signals": {}
"application_signals": {},
"otlp": {
"grpc_endpoint": "0.0.0.0:4317",
"http_endpoint": "0.0.0.0:4318"
}
}
}
}
13 changes: 11 additions & 2 deletions terraform/python/ec2/default/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,24 @@ resource "null_resource" "main_service_setup" {
export DJANGO_SETTINGS_MODULE="django_frontend_service.settings"
export OTEL_PYTHON_DISTRO="aws_distro"
export OTEL_PYTHON_CONFIGURATOR="aws_configurator"
export OTEL_METRICS_EXPORTER=none
export OTEL_METRICS_EXPORTER=otlp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this change anything about the regular test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but not in a negative way. It is also necessary for the CWAgent to function correctly.
https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AppSignals-CustomMetrics.html#AppSignals-CustomMetrics-OpenTelemetry

export OTEL_TRACES_EXPORTER=otlp
export OTEL_AWS_APPLICATION_SIGNALS_ENABLED=true
export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://localhost:4315
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4315
export OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=grpc
export OTEL_EXPORTER_OTLP_METRICS_PROTOCOL=grpc
export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=localhost:4317
export OTEL_EXPORTER_OTLP_INSECURE=true
export OTEL_SERVICE_NAME=python-sample-application-${var.test_id}
export OTEL_TRACES_SAMPLER=always_on
export OTEL_RESOURCE_ATTRIBUTES="Service=python-sample-application-${var.test_id},Environment=ec2:default"
export AWS_REGION='${var.aws_region}'
export CUSTOM_METRICS_ENABLED='${var.custom_metrics_enabled}'
export RDS_MYSQL_CLUSTER_ENDPOINT='dummy-endpoint'
export RDS_MYSQL_CLUSTER_PASSWORD='ZHVtbXk=' # base64 encoded 'dummy'
export RDS_MYSQL_CLUSTER_USERNAME='dummy-user'
export RDS_MYSQL_CLUSTER_DATABASE='dummy-db'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need these, EC2 tests don't test against RDS. If the sample app expects the credentials to be available, make it not be the case

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be updated in the next push

python${var.language_version} manage.py migrate
nohup opentelemetry-instrument python${var.language_version} manage.py runserver 0.0.0.0:8000 --noreload &

Expand Down Expand Up @@ -276,7 +285,7 @@ resource "null_resource" "remote_service_setup" {

# Copy in CW Agent configuration
agent_config='${replace(replace(file("./amazon-cloudwatch-agent.json"), "/\\s+/", ""), "$REGION", var.aws_region)}'
echo $agent_config > amazon-cloudwatch-agent.json
echo "$agent_config" > amazon-cloudwatch-agent.json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agent_config goes through the replace function and the quotes are just to prevent word splitting from breaking it.


# Get and run CW agent rpm
${var.get_cw_agent_rpm_command}
Expand Down
8 changes: 8 additions & 0 deletions terraform/python/ec2/default/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,12 @@ variable "language_version" {

variable "cpu_architecture" {
default = "x86_64"
}

#Adding Custom Metrics Variables

variable "custom_metrics_enabled" {
description = "Enable custom OTEL metrics in the sample application"
type = bool
default = false
}
4 changes: 2 additions & 2 deletions terraform/python/lambda/lambda/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ variable "is_canary" {

variable "region" {
type = string
description = "Lambda function running region, default value is us-west-2"
default = "us-west-2"
description = "Lambda function running region, default value is us-east-1"
default = "us-east-1"
}

variable "layer_artifacts_directory" {
Expand Down
2 changes: 1 addition & 1 deletion validator/src/main/java/com/amazon/aoc/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public class App implements Callable<Integer> {

@CommandLine.Option(
names = {"--region"},
defaultValue = "us-west-2")
defaultValue = "us-east-1")
private String region;

@CommandLine.Option(names = {"--availability-zone"})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ public enum PredefinedExpectedTemplate implements FileConfig {
PYTHON_EC2_DEFAULT_CLIENT_CALL_METRIC("/expected-data-template/python/ec2/default/client-call-metric.mustache"),
PYTHON_EC2_DEFAULT_CLIENT_CALL_TRACE("/expected-data-template/python/ec2/default/client-call-trace.mustache"),

/** Python EC2 Default Custom Metrics Test Case Validations */
PYTHON_EC2_DEFAULT_AWS_OTEL_CUSTOM_METRIC("/expected-data-template/python/ec2/default/aws-otel-custom-metrics.mustache"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/** Python EC2 Default Custom Metrics Test Case Validations */
PYTHON_EC2_DEFAULT_AWS_OTEL_CUSTOM_METRIC("/expected-data-template/python/ec2/default/aws-otel-custom-metrics.mustache"),
/** Python EC2 Default Custom Metrics Test Case Validations */
PYTHON_EC2_DEFAULT_AWS_OTEL_CUSTOM_METRIC("/expected-data-template/python/ec2/default/aws-otel-custom-metrics.mustache"),

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be updated in the next push


/** Python EC2 Asg Test Case Validations */
PYTHON_EC2_ASG_OUTGOING_HTTP_CALL_LOG("/expected-data-template/python/ec2/asg/outgoing-http-call-log.mustache"),
PYTHON_EC2_ASG_OUTGOING_HTTP_CALL_METRIC("/expected-data-template/python/ec2/asg/outgoing-http-call-metric.mustache"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ public void validate() throws Exception {
validateAnyMetricExists();
return;
}
// We will query the Service, RemoteService, and RemoteTarget dimensions to ensure we
// get all metrics from all aggregations, specifically the [RemoteService] aggregation.
// Query the Service, RemoteService, and RemoteTarget dimensions to ensure we
// Get all metrics from all aggregations, specifically the [RemoteService] aggregation.
List<String> serviceNames =
Lists.newArrayList(
context.getServiceName(), context.getRemoteServiceDeploymentName());
Expand Down Expand Up @@ -158,9 +158,9 @@ private void addMetrics(
List<Metric> actualMetricList)
throws Exception {
for (String dimensionValue : dimensionValues) {
actualMetricList.addAll(
this.listMetricFromCloudWatch(
cloudWatchService, expectedMetricList, dimensionName, dimensionValue));
List<Metric> foundMetrics = this.listMetricFromCloudWatch(
cloudWatchService, expectedMetricList, dimensionName, dimensionValue);
actualMetricList.addAll(foundMetrics);
}
}

Expand Down Expand Up @@ -245,9 +245,10 @@ private List<Metric> listMetricFromCloudWatch(
// search by metric name
List<Metric> result = new ArrayList<>();
for (String metricName : metricNameMap.keySet()) {
result.addAll(
cloudWatchService.listMetrics(
metricNameMap.get(metricName), metricName, dimensionKey, dimensionValue));
String namespace = metricNameMap.get(metricName);

List<Metric> metrics = cloudWatchService.listMetrics(namespace, metricName, dimensionKey, dimensionValue);
result.addAll(metrics);
}
return result;
}
Expand Down
Loading