Skip to content

Conversation

@ianbotsf
Copy link
Contributor

@ianbotsf ianbotsf commented Mar 3, 2025

Issue #

(none)

Description of changes

This change adds the emit-metrics action to our update-release-branch workflow and tracks several new data about our release job.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ianbotsf ianbotsf added the no-changelog Indicates that a changelog entry isn't required for a pull request. Use sparingly. label Mar 3, 2025
@ianbotsf ianbotsf requested a review from a team as a code owner March 3, 2025 18:12
@ianbotsf ianbotsf changed the title Chore updatereleasebranch metrics chore: Add metrics to update-release-branch workflow Mar 3, 2025
@github-actions
Copy link

github-actions bot commented Mar 3, 2025

A new generated diff is ready to view.

  • No codegen difference in the AWS SDK

duration=$(( now - ${{ steps.start.outputs.timestamp }} ))
printf 'duration=$duration\n' >> "$GITHUB_OUTPUT"
- name: Emit metrics
if: always()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: What does this if do, is it necessary?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it ensures we always run this step regardless of failure or cancelation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It forces this step to always run, even if previous steps failed. By default, every step implicitly has if: success() (meaning only run this step if no previous steps failed) unless explicitly overridden.

Comment on lines +30 to +32
- name: Set start timestamp
id: start
run: printf 'timestamp=%(%s)T\n' >> "$GITHUB_OUTPUT"
Copy link
Member

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.

Copy link
Contributor Author

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.

if: always()
uses: awslabs/aws-kotlin-repo-tools/.github/actions/emit-metrics
with:
namespace: CI metrics
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

naming: Is this name what appears in our CloudWatch dashboard, should it be "CI Metrics"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is and it should be.

metrics: |
ReleaseMergeAttempted:1:Count
ReleaseMergeSucceeded:${{ job.status == 'success' && '1' || '0' }}:Count
ReleaseMergeCancelled:${{ job.status == 'cancelled' && '1' || '0' }}:Count
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

naming suggestion: ReleaseMergeCanceled

@github-actions

This comment has been minimized.

duration=$(( now - ${{ steps.start.outputs.timestamp }} ))
printf 'duration=$duration\n' >> "$GITHUB_OUTPUT"
- name: Emit metrics
if: always()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it ensures we always run this step regardless of failure or cancelation

Trigger=${{ github.event_name == 'schedule' && 'schedule' || 'manual' }}
metrics: |
ReleaseMergeAttempted:1:Count
ReleaseMergeSucceeded:${{ job.status == 'success' && '1' || '0' }}:Count
Copy link
Contributor

Choose a reason for hiding this comment

The 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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.

duration=$(( now - ${{ steps.start.outputs.timestamp }} ))
printf 'duration=$duration\n' >> "$GITHUB_OUTPUT"
- name: Emit metrics
if: always()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Adding a comment explaining why this is here

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 4, 2025

@github-actions
Copy link

github-actions bot commented Mar 4, 2025

A new generated diff is ready to view.

  • No codegen difference in the AWS SDK

@github-actions
Copy link

github-actions bot commented Mar 4, 2025

Affected Artifacts

Changed in size
Artifact Pull Request (bytes) Latest Release (bytes) Delta (bytes) Delta (percentage)
ec2instanceconnect-jvm.jar closure 8,087,859 8,087,866 -7 -0.00%
transcribe-jvm.jar closure 9,810,035 9,810,055 -20 -0.00%
sagemaker-jvm.jar closure 27,801,156 27,801,413 -257 -0.00%
transcribe-jvm.jar 1,934,069 1,934,090 -21 -0.00%
sagemaker-jvm.jar 19,925,190 19,925,448 -258 -0.00%
ec2instanceconnect-jvm.jar 211,893 211,901 -8 -0.00%
cognitoidentityprovider-jvm.jar closure 12,424,563 12,435,890 -11,327 -0.09%
ec2-jvm.jar closure 37,197,557 37,249,904 -52,347 -0.14%
ec2-jvm.jar 29,321,591 29,373,939 -52,348 -0.18%
cognitoidentityprovider-jvm.jar 4,548,597 4,559,925 -11,328 -0.25%
qbusiness-jvm.jar closure 11,697,154 11,779,983 -82,829 -0.70%
rum-jvm.jar closure 8,572,567 8,670,031 -97,464 -1.12%
qbusiness-jvm.jar 3,736,981 3,819,811 -82,830 -2.17%
rum-jvm.jar 696,601 794,066 -97,465 -12.27%

@ianbotsf ianbotsf merged commit 646ab5a into main Mar 4, 2025
19 checks passed
@ianbotsf ianbotsf deleted the chore-updatereleasebranch-metrics branch March 4, 2025 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog Indicates that a changelog entry isn't required for a pull request. Use sparingly.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants