CICD-362 · Deployment marker creation
Encyclopedia · Observability and SRE pipelines · All snippets
Previous · CICD-361 · Next · CICD-363
1. Where it fits
- Placement CI run step or authorized lab terminal.
- Prerequisites staging metrics stack, provisioned endpoints and read-only CI identity except explicitly approved writes.
- Platforms local-linux, github-actions, gitea-actions.
- Parameters
GRAFANA_TOKEN,GRAFANA_URL,RELEASE_SHA.
2. Copy the snippet
bash
jq -n --arg sha "${RELEASE_SHA:?}" '{text:("Deploy " + $sha),tags:["deployment","staging"]}' | curl -fsS "${GRAFANA_URL:?}/api/annotations" -H "Authorization: Bearer ${GRAFANA_TOKEN:?}" -H 'Content-Type: application/json' --data-binary @-3. How it works
The expression filters or transforms the input JSON. Where jq -e is used, a false or empty result can fail the gate. The request checks the selected HTTP interface. Timeouts limit waiting, and an explicit exit or payload condition determines pass and fail.
4. Verify the result
Use a scoped Grafana service account. Search annotations by deployment tag after the rollout.
Watch for. Use the intended trusted execution context. Keep secret values out of traces, artifacts and debug output.
Validation syntax-validated (Bash parse). Status definitions.