Continuous monitoring of distribution channels #166242
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Continuous monitoring of distribution channels | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '*/10 * * * *' | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
smoke-tests: | |
name: Run smoke tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.AWS_INTEG_TEST_ROLE_ARN }} | |
aws-region: us-east-1 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 2.7 | |
env: | |
TEST_DISTRIBUTION: true | |
- name: Install dependencies | |
run: bundle install | |
env: | |
TEST_DISTRIBUTION: true | |
- name: Run distribution test | |
id: distribution-availability | |
run: bundle exec rake test_distribution | |
env: | |
TEST_DISTRIBUTION: true | |
- name: Publish metric on X-Ray Ruby SDK distribution availability | |
if: ${{ always() }} | |
run: | | |
if [[ "${{ steps.distribution-availability.outcome }}" == "failure" ]]; then | |
aws cloudwatch put-metric-data --metric-name XRayRubySDKDistributionUnavailability --dimensions failure=rate --namespace MonitorSDK --value 1 --timestamp $(date +%s) | |
else | |
aws cloudwatch put-metric-data --metric-name XRayRubySDKDistributionUnavailability --dimensions failure=rate --namespace MonitorSDK --value 0 --timestamp $(date +%s) | |
fi |