-
Notifications
You must be signed in to change notification settings - Fork 55
chore: Add metrics to update-release-branch workflow #1543
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,11 +27,21 @@ jobs: | |
| update-release: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Set start timestamp | ||
| id: start | ||
| run: printf 'timestamp=%(%s)T\n' >> "$GITHUB_OUTPUT" | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| ref: 'main' | ||
| fetch-depth: 0 | ||
| token: ${{ secrets.CI_USER_PAT }} | ||
| - name: Configure AWS Credentials | ||
| uses: aws-actions/configure-aws-credentials@v4 | ||
| with: | ||
| role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }} | ||
| aws-region: us-west-2 | ||
| - name: Setup kat | ||
| uses: awslabs/aws-kotlin-repo-tools/.github/actions/setup-kat@main | ||
| - name: Configure Git | ||
| shell: bash | ||
| run: | | ||
|
|
@@ -107,3 +117,23 @@ jobs: | |
| echo "pushing changes to release branch"; | ||
| git push origin release; | ||
| fi | ||
| - name: Calculate duration | ||
| id: end | ||
| run: | | ||
| printf -v now '%(%s)T' | ||
| duration=$(( now - ${{ steps.start.outputs.timestamp }} )) | ||
| printf 'duration=$duration\n' >> "$GITHUB_OUTPUT" | ||
| - name: Emit metrics | ||
| if: always() | ||
|
||
| uses: awslabs/aws-kotlin-repo-tools/.github/actions/emit-metrics | ||
| with: | ||
| namespace: CI metrics | ||
|
||
| dimensions: | | ||
| Product=aws-sdk-kotlin | ||
| Trigger=${{ github.event_name == 'schedule' && 'schedule' || 'manual' }} | ||
| metrics: | | ||
| ReleaseMergeAttempted:1:Count | ||
| ReleaseMergeSucceeded:${{ job.status == 'success' && '1' || '0' }}:Count | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Question: If the job is canceled or fails before this step runs, would we still be able to emit metrics?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As you noted above, this step will always run regardless of whether previous steps have failed or the job's been canceled. |
||
| ReleaseMergeCancelled:${{ job.status == 'cancelled' && '1' || '0' }}:Count | ||
|
||
| ReleaseMergeFailed:${{ job.status == 'failure' && '1' || '0' }}:Count | ||
| ReleaseMergeDuration:${{ steps.end.outputs.duration }}:Seconds | ||
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.
Is duration a meaningful metric for this job? Since it runs on an automated schedule at 3AM, I don't think we care if it takes 5, 15, even 30 minutes, just that it succeeds or fails.
GitHub already has a default timeout of 6 hours, so we could never get into a situation where the job runs for 24+ hours and conflicts with subsequent merge jobs.
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.
I believe durations are always useful, particularly when they start being larger/smaller than one expects. You're right, we don't necessarily care whether it's 5 minutes or 30 minutes but we probably care if it's always been 5 minutes and suddenly becomes 30 minutes.
Additionally, we do run this job manually from time to time which means we'd be waiting for it to complete. In that case, I believe we would care more about time.