-
Notifications
You must be signed in to change notification settings - Fork 317
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
feat: log metrics to github-workflows account #2613
Conversation
|
bf820e0
to
77bc7c8
Compare
Co-authored-by: William Lee <43682783+wlee221@users.noreply.github.com>
ee5e645
to
0543f8f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last typo nit, but lgtm otherwise
.github/workflows/publish-latest.yml
Outdated
# Send data point 0 to metric PublishLatestFailure, if it's a success | ||
log-success-metric-prod: | ||
# to be deprecated once log-success-metric is up | ||
# Send data point 0 to metric PublishLatestFailure in prod us-east-1, if it's a success |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Send data point 0 to metric PublishLatestFailure in prod us-east-1, if it's a success | |
# Send data point 0 to metric PublishLatestFailure in prod us-east-1, if it's a success |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching! Fixed them all
.github/workflows/publish-next.yml
Outdated
@@ -177,3 +180,39 @@ jobs: | |||
value: 0 | |||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |||
AWS_REGION: us-east-1 | |||
|
|||
log-failure-metric: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eventually, I think we can abstract log-failure-metric and log-success metric.
Maybe some input like this:
with:
status: 'success' | 'failure'
successValue: 0 # Optional, will not send anything if not supplied
failureValue: 1 # Optional, will not send anything if not supplied
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I'm good as-is now to keep change surface area low.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! Just consolidated them into 1 action
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooh, I was talking about refactoring the action itself (sorry if it wasn't clear). But I like what you have!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was clear and I thought about changing the action, but I think this way we can keep the action flexible so that potentially we can log different values beyond successValue
and failureValue
😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sgtm!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
failure()
doesn't work outside if:
, so I had to give up using that way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good thing we did a poc test 😈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one more spacing nit, but lgtm!
Description of changes
This PR is one of the steps to migrate Github Workflow related resources from aws-amplify-ui@ to aws-amplify-ui+github-workflows@.
log-success/failure-metric-prod
Issue #, if available
Description of how you validated changes
Tested in the PoC workflow https://github.com/aws-amplify/amplify-ui/actions/runs/3095070222/jobs/5009138998
PoC branch https://github.com/aws-amplify/amplify-ui/tree/poc/gh-workflow/metric-logger-cred
Checklist
yarn test
passessideEffects
field updatedBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.