Skip to content
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

Fix log failure metric #2646

Merged
merged 2 commits into from
Sep 26, 2022
Merged
Show file tree
Hide file tree
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
17 changes: 12 additions & 5 deletions .github/workflows/build-and-runtime-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Triggered by: it runs every 15 minutes.

name: Run and Test Builds
name: Build and Runtime Test

on:
schedule:
Expand Down Expand Up @@ -135,23 +135,30 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1

log-metric:
# Send data point to metric BuildAndRuntimeTestFailure in github-workflows@ us-east-2, if it's a failure
log-failure-metric:
# Send a failure data point to metric BuildAndRuntimeTestFailure in github-workflows@ us-east-2, if it's a failure
runs-on: ubuntu-latest
environment: ci
needs: build
if: ${{ failure() }}
steps:
- name: Log failure data point to metric BuildAndRuntimeTestFailure
if: ${{ failure() }}
uses: aws-amplify/amplify-ui/.github/actions/log-metric@main
with:
metric-name: BuildAndRuntimeTestFailure
value: 1
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_METRIC_LOGGER }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_METRIC_LOGGER }}
AWS_REGION: us-east-2

log-success-metric:
# Send a success data point to metric BuildAndRuntimeTestFailure in github-workflows@ us-east-2, if it's a success
runs-on: ubuntu-latest
environment: ci
needs: build
if: ${{ success() }}
steps:
- name: Log success data point to metric BuildAndRuntimeTestFailure
if: ${{ success() }}
uses: aws-amplify/amplify-ui/.github/actions/log-metric@main
with:
metric-name: BuildAndRuntimeTestFailure
Expand Down
15 changes: 11 additions & 4 deletions .github/workflows/publish-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,23 +139,30 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1

log-metric:
# Send data point to metric PublishLatestFailure in github-workflows@ us-east-2
log-failure-metric:
# Send a failure data point to metric PublishLatestFailure in github-workflows@ us-east-2
runs-on: ubuntu-latest
environment: ci
needs: publish
if: ${{ failure() }}
steps:
- name: Log failure data point to metric PublishLatestFailure
if: ${{ failure() }}
uses: aws-amplify/amplify-ui/.github/actions/log-metric@main
with:
metric-name: PublishLatestFailure
value: 1
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_METRIC_LOGGER }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_METRIC_LOGGER }}
AWS_REGION: us-east-2

log-success-metric:
# Send a success data point to metric PublishLatestFailure in github-workflows@ us-east-2
runs-on: ubuntu-latest
environment: ci
needs: publish
if: ${{ success() }}
steps:
- name: Log success data point to metric PublishLatestFailure
if: ${{ success() }}
uses: aws-amplify/amplify-ui/.github/actions/log-metric@main
with:
metric-name: PublishLatestFailure
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/publish-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,12 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1

log-metric:
# Send data point to metric PublishNextFailure in github-workflows@ us-east-2, if it's a failure
log-failure-metric:
# Send a failure data point to metric PublishNextFailure in github-workflows@ us-east-2, if it's a failure
runs-on: ubuntu-latest
environment: ci
needs: build-test
if: ${{ failure() }}
steps:
- name: Log failure data point to metric PublishNextFailure
if: ${{ failure() }}
Expand All @@ -197,6 +198,14 @@ jobs:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_METRIC_LOGGER }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_METRIC_LOGGER }}
AWS_REGION: us-east-2

log-success-metric:
# Send a success data point to metric PublishNextFailure in github-workflows@ us-east-2, if it's a success
runs-on: ubuntu-latest
environment: ci
needs: build-test
if: ${{ success() }}
steps:
- name: Log success data point to metric PublishNextFailure
if: ${{ success() }}
uses: aws-amplify/amplify-ui/.github/actions/log-metric@main
Expand Down