Continuous monitoring of distribution channels #157996
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 * * * *' | |
jobs: | |
pull-agent: | |
name: Pull X-Ray java agent from Maven Central and Github | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout X-Ray Java agent 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 | |
- name: Pull Java agent from Github | |
id: distribution-availability-github | |
run: wget https://github.com/aws/aws-xray-java-agent/releases/latest/download/xray-agent.zip | |
- name: Publish metric on X-Ray Java agent distribution availability (Github) | |
if: ${{ always() }} | |
run: | | |
if [[ "${{ steps.distribution-availability-github.outcome }}" == "failure" ]]; then | |
aws cloudwatch put-metric-data --metric-name XRayJavaAgentGithubDistributionUnavailability --dimensions failure=rate --namespace MonitorAgent --value 1 --timestamp $(date +%s) | |
else | |
aws cloudwatch put-metric-data --metric-name XRayJavaAgentGithubDistributionUnavailability --dimensions failure=rate --namespace MonitorAgent --value 0 --timestamp $(date +%s) | |
fi | |
- name: Pull Java agent from Maven | |
id: distribution-availability-maven | |
run: | | |
git fetch --prune --unshallow --tags | |
version=$(git tag -l | sort -rV | head -1 | tr -d 'v') | |
wget https://repo.maven.apache.org/maven2/com/amazonaws/aws-xray-agent-plugin/$version/aws-xray-agent-plugin-$version.jar | |
- name: Publish metric on X-Ray Java agent distribution availability (Maven) | |
if: ${{ always() }} | |
run: | | |
if [[ "${{ steps.distribution-availability-maven.outcome }}" == "failure" ]]; then | |
aws cloudwatch put-metric-data --metric-name XRayJavaAgentMavenDistributionUnavailability --dimensions failure=rate --namespace MonitorAgent --value 1 --timestamp $(date +%s) | |
else | |
aws cloudwatch put-metric-data --metric-name XRayJavaAgentMavenDistributionUnavailability --dimensions failure=rate --namespace MonitorAgent --value 0 --timestamp $(date +%s) | |
fi |