diff --git a/.github/workflows/continuous-monitoring.yml b/.github/workflows/continuous-monitoring.yml index a8f60769..6cb3ffc2 100644 --- a/.github/workflows/continuous-monitoring.yml +++ b/.github/workflows/continuous-monitoring.yml @@ -2,7 +2,7 @@ name: Continuous monitoring of distribution channels on: workflow_dispatch: schedule: - - cron: '0 */6 * * *' + - cron: '0 */1 * * *' jobs: smoke-tests: @@ -11,9 +11,29 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v2 + + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-east-1 + - uses: actions/setup-python@v2 with: python-version: '3.x' + - run: pip install tox + - name: Run smoke tests + id: distribution-availability run: tox -c tox-distributioncheck.ini + + - name: Publish metric on X-Ray Python SDK distribution availability + if: ${{ always() }} + run: | + if [[ "${{ steps.distribution-availability.outcome }}" == "failure" ]]; then + aws cloudwatch put-metric-data --metric-name XRayPythonSDKDistributionAvailability --dimensions failure=rate --namespace MonitorSDK --value 1 --timestamp $(date +%s) + else + aws cloudwatch put-metric-data --metric-name XRayPythonSDKDistributionAvailability --dimensions failure=rate --namespace MonitorSDK --value 0 --timestamp $(date +%s) + fi