Skip to content

Continuous monitoring of distribution channels #164759

Continuous monitoring of distribution channels

Continuous monitoring of distribution channels #164759

name: Continuous monitoring of distribution channels
on:
workflow_dispatch:
schedule:
- cron: '*/10 * * * *'
jobs:
smoke-tests:
name: Run smoke tests
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v1
- 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
- name: Setup java
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache Gradle Wrapper
uses: actions/cache@v1
with:
path: ~/.gradle/wrapper
key: gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
- name: Run smoke tests
id: distribution-availability
run: |
(echo "===== Attempt: 1 ====" && ./gradlew :smoke-tests:check -PtestDistributionChannel=true) || \
(echo "===== Attempt: 2 ====" && ./gradlew :smoke-tests:check -PtestDistributionChannel=true) || \
(echo "===== Attempt: 3 ====" && ./gradlew :smoke-tests:check -PtestDistributionChannel=true) || \
(echo "===== No more retries. Failed! ====" && exit 1)
- name: Publish metric on X-Ray Java SDK distribution availability
if: ${{ always() }}
run: |
if [[ "${{ steps.distribution-availability.outcome }}" == "failure" ]]; then
aws cloudwatch put-metric-data --metric-name XRayJavaSDKDistributionUnavailability --dimensions failure=rate --namespace MonitorSDK --value 1 --timestamp $(date +%s)
else
aws cloudwatch put-metric-data --metric-name XRayJavaSDKDistributionUnavailability --dimensions failure=rate --namespace MonitorSDK --value 0 --timestamp $(date +%s)
fi