Skip to content

Commit

Permalink
[cloud deploy] Enable stack monitoring (elastic#126278)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbudz authored and lucasfcosta committed Mar 2, 2022
1 parent 6e0e2a8 commit e613fb9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .buildkite/scripts/steps/cloud/build_and_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ if [ -z "${CLOUD_DEPLOYMENT_ID}" ]; then
CLOUD_DEPLOYMENT_ID=$(jq -r --slurp '.[0].id' "$JSON_FILE")
CLOUD_DEPLOYMENT_STATUS_MESSAGES=$(jq --slurp '[.[]|select(.resources == null)]' "$JSON_FILE")

# Enable stack monitoring
jq '
.settings.observability.metrics.destination.deployment_id = "'$CLOUD_DEPLOYMENT_ID'" |
.settings.observability.logging.destination.deployment_id = "'$CLOUD_DEPLOYMENT_ID'"
' .buildkite/scripts/steps/cloud/stack_monitoring.json > /tmp/stack_monitoring.json
ecctl deployment update "$CLOUD_DEPLOYMENT_ID" --track --output json --file /tmp/stack_monitoring.json &> "$JSON_FILE"

# Refresh vault token
VAULT_ROLE_ID="$(retry 5 15 gcloud secrets versions access latest --secret=kibana-buildkite-vault-role-id)"
VAULT_SECRET_ID="$(retry 5 15 gcloud secrets versions access latest --secret=kibana-buildkite-vault-secret-id)"
Expand Down
19 changes: 19 additions & 0 deletions .buildkite/scripts/steps/cloud/stack_monitoring.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"prune_orphans": false,
"settings": {
"observability": {
"metrics": {
"destination": {
"deployment_id": null,
"ref_id": "main-elasticsearch"
}
},
"logging": {
"destination": {
"deployment_id": null,
"ref_id": "main-elasticsearch"
}
}
}
}
}

0 comments on commit e613fb9

Please sign in to comment.