@@ -172,7 +172,7 @@ jobs:
172172 -var="language_version=${{ env.PYTHON_VERSION }}" \
173173 -var="cpu_architecture=${{ env.CPU_ARCHITECTURE }}" \
174174 || deployment_failed=$?
175-
175+
176176 if [ $deployment_failed -eq 1 ]; then
177177 echo "Terraform deployment was unsuccessful. Will attempt to retry deployment."
178178 fi
@@ -252,9 +252,28 @@ jobs:
252252 --instance-id ${{ env.MAIN_SERVICE_INSTANCE_ID }}
253253 --rollup'
254254
255+ # Creating a separate validation for custom metrics
256+ - name : Validate custom metrics
257+ id : cwagent-metric-validation
258+ if : (success() || steps.log-validation.outcome == 'failure' || steps.metric-validation.outcome == 'failure') && !cancelled()
259+ run : ./gradlew validator:run --args='-c python/ec2/default/custom-metric-validation.yml
260+ --testing-id ${{ env.TESTING_ID }}
261+ --account-id ${{ env.ACCOUNT_ID }}
262+ --endpoint http://${{ env.MAIN_SERVICE_ENDPOINT }}
263+ --remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8001
264+ --region ${{ env.E2E_TEST_AWS_REGION }}
265+ --metric-namespace CWAgent
266+ --log-group ${{ env.LOG_GROUP_NAME }}
267+ --service-name python-sample-application-${{ env.TESTING_ID }}
268+ --remote-service-name python-sample-remote-application-${{ env.TESTING_ID }}
269+ --query-string ip=${{ env.REMOTE_SERVICE_IP }}
270+ --instance-ami ${{ env.EC2_INSTANCE_AMI }}
271+ --instance-id ${{ env.MAIN_SERVICE_INSTANCE_ID }}
272+ --rollup'
273+
255274 - name : Validate generated traces
256275 id : trace-validation
257- if : (success() || steps.log-validation.outcome == 'failure' || steps.metric-validation.outcome == 'failure') && !cancelled()
276+ if : (success() || steps.log-validation.outcome == 'failure' || steps.metric-validation.outcome == 'failure' || steps.cwagent-metric-validation.outcome == 'failure' ) && !cancelled()
258277 run : ./gradlew validator:run --args='-c python/ec2/default/trace-validation.yml
259278 --testing-id ${{ env.TESTING_ID }}
260279 --endpoint http://${{ env.MAIN_SERVICE_ENDPOINT }}
@@ -281,7 +300,7 @@ jobs:
281300 if : always()
282301 id : validation-result
283302 run : |
284- if [ "${{ steps.log-validation.outcome }}" = "success" ] && [ "${{ steps.metric-validation.outcome }}" = "success" ] && [ "${{ steps.trace-validation.outcome }}" = "success" ]; then
303+ if [ "${{ steps.log-validation.outcome }}" = "success" ] && [ "${{ steps.cwagent-metric-validation.outcome }}" = "success" ] && [ "${{ steps. metric-validation.outcome }}" = "success" ] && [ "${{ steps.trace-validation.outcome }}" = "success" ]; then
285304 echo "validation-result=success" >> $GITHUB_OUTPUT
286305 else
287306 echo "validation-result=failure" >> $GITHUB_OUTPUT
0 commit comments