From 00bf50f64d2886594f6f3203725cd7ce703ef4f4 Mon Sep 17 00:00:00 2001 From: Tim Cosgrove Date: Wed, 4 Sep 2024 10:08:54 -0700 Subject: [PATCH] Adds action to send GHA stats to Datadog. (#715) --- .github/workflows/gha-metrics-datadog.yml | 33 +++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/gha-metrics-datadog.yml diff --git a/.github/workflows/gha-metrics-datadog.yml b/.github/workflows/gha-metrics-datadog.yml new file mode 100644 index 000000000..ea5a9eb61 --- /dev/null +++ b/.github/workflows/gha-metrics-datadog.yml @@ -0,0 +1,33 @@ +name: 'Send GHA metrics to Datadog' +on: + workflow_run: + workflows: + - 'Content Release' + types: + - completed +jobs: + send: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef # v2.0.0 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-gov-west-1 + + # @todo: get Next Build specific API key + - name: Get Datadog api key from Parameter Store + uses: department-of-veterans-affairs/action-inject-ssm-secrets@d8e6de3bde4dd728c9d732baef58b3c854b8c4bb # latest + with: + ssm_parameter: /dsva-vagov/content-build/GHA_CONTENT_BUILD_DATADOG_API_KEY + env_variable_name: GHA_CONTENT_BUILD_DATADOG_API_KEY + + - name: Send GitHub Actions metrics to DataDog + uses: int128/datadog-actions-metrics@432f143460957c07e730f9f082af7d5063e99f84 # v1.88.0 + with: + datadog-api-key: ${{ env.GHA_CONTENT_BUILD_DATADOG_API_KEY }} + collect-job-metrics: true + collect-step-metrics: true + datadog-site: ddog-gov.com