Skip to content

Continuous monitoring of distribution channels #163672

Continuous monitoring of distribution channels

Continuous monitoring of distribution channels #163672

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: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
version: [netcoreapp3.1, net6.0]
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
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
3.1.x
6.0.x
- name: Install dependencies
run: dotnet restore sdk/test/SmokeTests/AWSXRayRecorder.SmokeTests.csproj
- name: Build tests
run: dotnet build sdk/test/SmokeTests/AWSXRayRecorder.SmokeTests.csproj --configuration Release --no-restore
- name: Run tests
id: distribution-availability
run: dotnet test sdk/test/SmokeTests/bin/Release/${{matrix.version}}/AWSXRayRecorder.SmokeTests.dll
- name: Publish metric on X-Ray Dotnet SDK distribution availability
if: ${{ always() }}
run: |
if [[ "${{ steps.distribution-availability.outcome }}" == "failure" ]]; then
aws cloudwatch put-metric-data --metric-name XRayDotnetSDKDistributionUnavailability --dimensions failure=rate --namespace MonitorSDK --value 1 --timestamp $(date +%s)
else
aws cloudwatch put-metric-data --metric-name XRayDotnetSDKDistributionUnavailability --dimensions failure=rate --namespace MonitorSDK --value 0 --timestamp $(date +%s)
fi