Skip to content

Commit

Permalink
feat(gcp): add label to instances for cost and logs grouping
Browse files Browse the repository at this point in the history
Previous behavior:
We couldn't search GCP logs using the instance name if that instance was
already deleted. And if we want to know how we're spending our budget its
also difficult to know if specific tests or type of instances are the one
responsible for a certain % of the costs

Fixes #5153
Fixses #5543

Expected behavior:
Be able to search logs using the test ID or at least the github reference,
and be able to group GCP costs by labels

Solution:
- Add labels to instances
  • Loading branch information
gustavovalverde committed Nov 22, 2022
1 parent 92ae381 commit bb15997
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/continous-delivery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ jobs:
--container-mount-disk mount-path="/zebrad-cache",name=zebrad-cache-${{ env.GITHUB_SHA_SHORT }} \
--machine-type ${{ env.MACHINE_TYPE }} \
--scopes cloud-platform \
--labels=app=zebrad,environment=prod,github_ref=${{ env.GITHUB_REF_SLUG_URL }} \
--tags zebrad
# Check if our destination instance group exists already
Expand Down Expand Up @@ -207,4 +208,5 @@ jobs:
--container-mount-disk mount-path='/zebrad-cache',name=zebrad-cache-${{ env.GITHUB_SHA_SHORT }} \
--machine-type ${{ env.MACHINE_TYPE }} \
--zone ${{ env.ZONE }} \
--labels=app=zebrad,environment=qa,github_ref=${{ env.GITHUB_REF_SLUG_URL }} \
--tags zebrad
2 changes: 2 additions & 0 deletions .github/workflows/deploy-gcp-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ jobs:
--scopes cloud-platform \
--metadata=google-monitoring-enabled=TRUE,google-logging-enabled=TRUE \
--metadata-from-file=startup-script=.github/workflows/scripts/gcp-vm-startup-script.sh \
--labels=app=${{ inputs.app_name }},environment=test,github_ref=${{ env.GITHUB_REF_SLUG_URL }},test=${{ inputs.test_id }} \
--tags ${{ inputs.app_name }} \
--zone ${{ env.ZONE }}
sleep 60
Expand Down Expand Up @@ -403,6 +404,7 @@ jobs:
--scopes cloud-platform \
--metadata=google-monitoring-enabled=TRUE,google-logging-enabled=TRUE \
--metadata-from-file=startup-script=.github/workflows/scripts/gcp-vm-startup-script.sh \
--labels=app=${{ inputs.app_name }},environment=test,github_ref=${{ env.GITHUB_REF_SLUG_URL }},test=${{ inputs.test_id }} \
--tags ${{ inputs.app_name }} \
--zone ${{ env.ZONE }}
sleep 60
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/zcashd-manual-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ jobs:
--machine-type ${{ env.MACHINE_TYPE }} \
--service-account ${{ env.DEPLOY_SA }} \
--scopes cloud-platform \
--labels=app=zcashd,environment=qa,github_ref=${{ env.GITHUB_REF_SLUG_URL }} \
--tags zcashd
# Check if our destination instance group exists already
Expand Down

0 comments on commit bb15997

Please sign in to comment.