Skip to content

Publish metric on distribution availability #279

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 24, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion .github/workflows/continuous-monitoring.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Continuous monitoring of distribution channels
on:
workflow_dispatch:
schedule:
- cron: '0 */6 * * *'
- cron: '0 */1 * * *'

jobs:
smoke-tests:
Expand All @@ -11,9 +11,29 @@ jobs:
steps:
- name: Checkout 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

- uses: actions/setup-python@v2
with:
python-version: '3.x'

- run: pip install tox

- name: Run smoke tests
id: distribution-availability
run: tox -c tox-distributioncheck.ini

- name: Publish metric on X-Ray Python SDK distribution availability
if: ${{ always() }}
run: |
if [[ "${{ steps.distribution-availability.outcome }}" == "failure" ]]; then
aws cloudwatch put-metric-data --metric-name XRayPythonSDKDistributionAvailability --dimensions failure=rate --namespace MonitorSDK --value 1 --timestamp $(date +%s)
else
aws cloudwatch put-metric-data --metric-name XRayPythonSDKDistributionAvailability --dimensions failure=rate --namespace MonitorSDK --value 0 --timestamp $(date +%s)
fi