← Blog

How to mark deploys on your metric charts with GitHub Actions

Signups dropped on Thursday afternoon. Was it the deploy? Without a marker on the chart you end up comparing timestamps from your CI history by hand. With one, the answer is on the chart: a note saying Deployed 3f9c2a1 right where the line bends.

This guide adds those notes automatically from GitHub Actions. It takes one workflow step and one secret.

How it works

Umlogger calls these notes annotations. Each one has a time and a short text, belongs to one metric, and shows on that metric's chart. You can add them by hand on the chart, ask an AI tool to add one, or add them from a script through the MCP server, which accepts plain HTTP requests as well as AI tools. The workflow step below does the last one.

Step 1: create an access token

In Umlogger, go to Settings → Access tokens and create a token with read & write access. Leave the setting that lets it change and delete metrics off: adding notes doesn't need it. The token works on metrics you own or that are shared with you.

In GitHub, add it as a repository secret called UMLOGGER_TOKEN under Settings → Secrets and variables → Actions.

Step 2: add the step to your deploy workflow

Put this after your deploy step. List the slugs of the metrics you want marked; the slug is in each metric's URL. If anything goes wrong, the step shows a warning but never fails your deploy.

      - name: Mark the deploy on Umlogger charts
        if: success()
        env:
          UMLOGGER_TOKEN: ${{ secrets.UMLOGGER_TOKEN }}
        run: |
          for METRIC in signups orders response-time; do
            BODY=$(jq -n --arg metric "$METRIC" --arg note "Deployed ${GITHUB_SHA::7}" \
              '{jsonrpc: "2.0", id: 1, method: "tools/call",
                params: {name: "add_annotation", arguments: {metric: $metric, note: $note}}}')
            if ! RESPONSE=$(curl -fsS --max-time 10 -X POST "https://data.umlogger.com/mcp" \
                -H "Authorization: Bearer $UMLOGGER_TOKEN" \
                -H "Content-Type: application/json" \
                -H "Accept: application/json, text/event-stream" \
                -d "$BODY"); then
              echo "::warning::Couldn't send the note to Umlogger. Check the UMLOGGER_TOKEN secret."
            elif grep -q '"isError":true' <<<"$RESPONSE"; then
              echo "::warning::Umlogger didn't add the note to $METRIC: $RESPONSE"
            else
              echo "Marked the deploy on $METRIC"
            fi
          done

GitHub's Ubuntu runners already have jq and curl. Using jq to build the request keeps quotes in the note from breaking it.

Make the note more useful

A commit hash is enough to find the change, but a few words save a click. Notes can be up to 500 characters. For example, use the first line of the commit message:

NOTE="Deployed ${GITHUB_SHA::7}: $(git log -1 --format=%s)"

This needs the repository checked out in the job, which most deploy jobs already do. Pass it to jq with --arg note "$NOTE".

Reading the chart after a deploy

Once the notes are there, a few habits make them pay off:

  • Compare with the period before. Turn on Show previous period to see whether a dip after a deploy is unusual or happens every Thursday.
  • Give it time. A count metric needs enough events to tell a change from noise. With a few signups an hour, wait at least a day before deciding.
  • Mark other changes too. Price changes, campaigns and outages at a provider explain as many bends in a line as deploys do. Add those notes by hand on the chart.
  • Ask your AI tool. With the MCP server connected, try: "Did signups change after the last deploy annotation? Compare the 24 hours after it with the same hours a week earlier."

Not using GitHub Actions?

The request is the same from any deploy script: GitLab CI, a Makefile or a shell script on the server. Keep the for loop, set UMLOGGER_TOKEN from your secret store, and replace GITHUB_SHA with your version. AI coding tools with the Umlogger skill can also add the note for you when they ship a change.

Want to count deploys as well? See sending metrics from GitHub Actions.