Skip to content

Commit

Permalink
chore: emit success or failure metrics for the release artifact colle…
Browse files Browse the repository at this point in the history
…ction job
  • Loading branch information
ianbotsf committed Jan 31, 2025
1 parent 2e3860f commit a890140
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/codebuild-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -237,3 +237,15 @@ jobs:
run: ./gradlew saveArtifactSizeMetrics -Prelease=${{ github.event.release.tag_name }}
- name: Put Artifact Size Metrics in CloudWatch
run: ./gradlew putArtifactSizeMetricsInCloudWatch -Prelease=${{ github.event.release.tag_name }}
- name: Emit success metric
if: ${{ success() }}
run: |
echo "::error ::Failed to collect and emit release artifact size metrics. Attempting to emit error metric to"
echo "::error ::CloudWatch..."
aws cloudwatch put-metric-data --namespace "Artifact Metrics" --metric-data file://./resources/artifact-metrics-collection-success.json
- name: Emit failure metric
if: ${{ failure() }}
run: |
echo "::error ::Failed to collect and emit release artifact size metrics. Attempting to emit error metric to"
echo "::error ::CloudWatch..."
aws cloudwatch put-metric-data --namespace "Artifact Metrics" --metric-data file://./resources/artifact-metrics-collection-failure.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[
{
"Dimensions": [
{
"Name": "Project",
"Value": "aws-sdk-kotlin"
}
],
"MetricName": "CollectionsAttempted",
"Unit": "Count",
"Value": 1
},
{
"Dimensions": [
{
"Name": "Project",
"Value": "aws-sdk-kotlin"
}
],
"MetricName": "CollectionsFailed",
"Unit": "Count",
"Value": 1
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[
{
"Dimensions": [
{
"Name": "Project",
"Value": "aws-sdk-kotlin"
}
],
"MetricName": "CollectionsAttempted",
"Unit": "Count",
"Value": 1
},
{
"Dimensions": [
{
"Name": "Project",
"Value": "aws-sdk-kotlin"
}
],
"MetricName": "CollectionsSucceeded",
"Unit": "Count",
"Value": 1
}
]

0 comments on commit a890140

Please sign in to comment.