Continuous monitoring of distribution channels #166757
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: | |
pull-agent: | |
name: Pull X-Ray .NET agent from github release | |
runs-on: ubuntu-latest | |
steps: | |
- 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: Pull X-Ray .NET agent from github release | |
id: distribution-availability-github | |
run: | | |
(echo "===== Attempt: 1 ====" && wget https://github.com/aws/aws-xray-dotnet-agent/releases/download/v2.10.0-beta.1/aws-xray-dotnet-agent-installer-beta-X64.msi && wget https://github.com/aws/aws-xray-dotnet-agent/releases/download/v2.10.0-beta.1/aws-xray-dotnet-agent-installer-beta-X86.msi) || \ | |
(echo "===== Attempt: 2 ====" && wget https://github.com/aws/aws-xray-dotnet-agent/releases/download/v2.10.0-beta.1/aws-xray-dotnet-agent-installer-beta-X64.msi && wget https://github.com/aws/aws-xray-dotnet-agent/releases/download/v2.10.0-beta.1/aws-xray-dotnet-agent-installer-beta-X86.msi) || \ | |
(echo "===== Attempt: 3 ====" && wget https://github.com/aws/aws-xray-dotnet-agent/releases/download/v2.10.0-beta.1/aws-xray-dotnet-agent-installer-beta-X64.msi && wget https://github.com/aws/aws-xray-dotnet-agent/releases/download/v2.10.0-beta.1/aws-xray-dotnet-agent-installer-beta-X86.msi) || \ | |
(echo "===== No more retries. Failed! ====" && exit 1) | |
- name: Publish metric on X-Ray .NET agent distribution availability (Github) | |
if: ${{ always() }} | |
run: | | |
if [[ "${{ steps.distribution-availability-github.outcome }}" == "failure" ]]; then | |
aws cloudwatch put-metric-data --metric-name XRayDotnetAgentGithubDistributionUnavailability --dimensions failure=rate --namespace MonitorAgent --value 1 --timestamp $(date +%s) | |
else | |
aws cloudwatch put-metric-data --metric-name XRayDotnetAgentGithubDistributionUnavailability --dimensions failure=rate --namespace MonitorAgent --value 0 --timestamp $(date +%s) | |
fi |