Skip to content

Continuous monitoring of distribution channels #163792

Continuous monitoring of distribution channels

Continuous monitoring of distribution channels #163792

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 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@v4
with:
role-to-assume: ${{ secrets.AWS_INTEG_TEST_ROLE_ARN }}
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