Skip to content

Commit 99b8711

Browse files
bhautikpipTyler Hargraves
authored and
Tyler Hargraves
committed
Publish metric on distribution availability (aws#279)
* Publish metric on distribution availability Publish metric on distribution availability * Corrected typo * Cronjob run every 1 hr
1 parent 652dd03 commit 99b8711

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

.github/workflows/continuous-monitoring.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Continuous monitoring of distribution channels
22
on:
33
workflow_dispatch:
44
schedule:
5-
- cron: '0 */6 * * *'
5+
- cron: '0 */1 * * *'
66

77
jobs:
88
smoke-tests:
@@ -11,9 +11,29 @@ jobs:
1111
steps:
1212
- name: Checkout Repository
1313
uses: actions/checkout@v2
14+
15+
- name: Configure AWS Credentials
16+
uses: aws-actions/configure-aws-credentials@v1
17+
with:
18+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
19+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
20+
aws-region: us-east-1
21+
1422
- uses: actions/setup-python@v2
1523
with:
1624
python-version: '3.x'
25+
1726
- run: pip install tox
27+
1828
- name: Run smoke tests
29+
id: distribution-availability
1930
run: tox -c tox-distributioncheck.ini
31+
32+
- name: Publish metric on X-Ray Python SDK distribution availability
33+
if: ${{ always() }}
34+
run: |
35+
if [[ "${{ steps.distribution-availability.outcome }}" == "failure" ]]; then
36+
aws cloudwatch put-metric-data --metric-name XRayPythonSDKDistributionAvailability --dimensions failure=rate --namespace MonitorSDK --value 1 --timestamp $(date +%s)
37+
else
38+
aws cloudwatch put-metric-data --metric-name XRayPythonSDKDistributionAvailability --dimensions failure=rate --namespace MonitorSDK --value 0 --timestamp $(date +%s)
39+
fi

0 commit comments

Comments
 (0)