From c4cd7e2cd47d1433346943a6f640174de76b788e Mon Sep 17 00:00:00 2001 From: Caleb Metz Date: Tue, 5 Nov 2024 16:21:34 -0500 Subject: [PATCH] Moved `datadog-ci tag` call to right after `smp submit` command. Signed-off-by: Caleb Metz --- .gitlab/functional_test/regression_detector.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.gitlab/functional_test/regression_detector.yml b/.gitlab/functional_test/regression_detector.yml index e8fe63f65387d..2619f53f6573c 100644 --- a/.gitlab/functional_test/regression_detector.yml +++ b/.gitlab/functional_test/regression_detector.yml @@ -109,6 +109,13 @@ single-machine-performance-regression_detector: --comparison-sha ${CI_COMMIT_SHA} --target-config-dir test/regression/ --submission-metadata submission_metadata + # `datadog-ci` relies on `DATADOG_API_KEY` so we get that here. + - DATADOG_API_KEY="$("$CI_PROJECT_DIR"/tools/ci/fetch_secret.sh "$AGENT_API_KEY_ORG2" token)" || exit $?; export DATADOG_API_KEY + # Get the SMP Job Id from 'submission-metadata' and use 'datadog-ci' + # to tag the gitlab job seen in CI Visibility with the SMP Job Id. + - SMP_JOB_ID = jq -r '.jobId' submission-metadata + - echo "SMP Job Id is ${SMP_JOB_ID}" + - datadog-ci tag --level job --tags job_id:${SMP_JOB_ID} # Wait for job to complete. - RUST_LOG="${RUST_LOG}" ./smp --team-id ${SMP_AGENT_TEAM_ID} --api-base ${SMP_API} --aws-named-profile ${AWS_NAMED_PROFILE} job status @@ -128,13 +135,7 @@ single-machine-performance-regression_detector: # invoke task has additional logic that does not seem to apply well to SMP's # JUnit XML. Agent CI seems to use `datadog-agent` as the service name when # uploading JUnit XML, so the upload command below respects that convention. - - DATADOG_API_KEY="$("$CI_PROJECT_DIR"/tools/ci/fetch_secret.sh "$AGENT_API_KEY_ORG2" token)" || exit $?; export DATADOG_API_KEY - datadog-ci junit upload --service datadog-agent outputs/junit.xml - # Get the SMP Job Id from 'submission-metadata' and use 'datadog-ci' - # to tag the gitlab job seen in CI Visibility with the SMP Job Id. - - SMP_JOB_ID = jq -r '.jobId' submission-metadata - - echo "SMP Job Id is ${SMP_JOB_ID}" - - datadog-ci tag --level job --tags job_id:${SMP_JOB_ID} # Finally, exit 1 if the job signals a regression else 0. - RUST_LOG="${RUST_LOG}" ./smp --team-id ${SMP_AGENT_TEAM_ID} --api-base ${SMP_API} --aws-named-profile ${AWS_NAMED_PROFILE} job result