Track deployments
A deployment is Morse’s record of which commit an agent is running in an environment, and since when. When Morse confirms a deploy from your runs, it measures the agent before and after that deploy automatically. The result is on the agent’s Changes tab, in the Deploys panel (see Measuring a deploy). It never says the deploy caused the movement.
Prompt, model and configuration edits are Changes, not deployments. Morse tracks those from the configuration fingerprint, whether or not you ship a new commit.
How Morse records a deployment
Morse keeps one current deployment per agent and environment. The environment is the one your API key belongs to.
- A new commit becomes the agent’s current deployment once it carries at least 3 runs and at least 60% of that agent’s runs in that environment over the trailing hour. For a low-volume agent the window widens to the trailing 24 hours.
- A commit that never gets there expires after 24 hours and is listed as ignored. This is typical of CI runs and local runs, which carry a commit but never serve real traffic.
- Going back to a commit that was current before is recorded as a rollback.
The commit comes from your runs, or from a report your CI sends. Pick whichever fits.
Pick a method
| Method | Use it when |
|---|---|
| Automatic | Your platform sets a build variable that holds the commit. |
| Docker or Kubernetes | You build an image and no platform variable reaches the running process. |
| OpenTelemetry | You send traces with an OTLP exporter and no Morse SDK. |
| Report from CI | Your agent calls models through a gateway only, or you want a CI record. |
You can combine them. A runs-based record and a CI report for the same commit confirm each other, and the deploy then reads Confirmed by CI.
Automatic
The Morse SDKs read the commit from the first of these that is set:
MORSE_GIT_REVISION, GITHUB_SHA, CI_COMMIT_SHA, RAILWAY_GIT_COMMIT_SHA,
VERCEL_GIT_COMMIT_SHA, RENDER_GIT_COMMIT, SOURCE_VERSION (Heroku).
On Railway the variable is only present for deploys that come from a GitHub source. The full list
and the fallback to git rev-parse HEAD are in
Record keys and versions.
GITHUB_SHA and CI_COMMIT_SHA are set in CI jobs, not on your servers. They are why test and
build runs in CI can show up in Morse as ignored revisions. That is expected and harmless: they
never become a deployment.
Docker or Kubernetes
A production image usually has no .git directory. Pass the commit in at build time:
ARG GIT_SHA
ENV MORSE_GIT_REVISION=$GIT_SHAdocker build --build-arg GIT_SHA=$(git rev-parse HEAD) .OpenTelemetry without the Morse SDK
Set the commit as a resource attribute. Any OpenTelemetry SDK reads it from the environment, so no code change is needed.
OTEL_RESOURCE_ATTRIBUTES=vcs.ref.head.revision=<commit sha>Morse also accepts git.revision. If both are set, git.revision wins.
See OTLP for the rest of the attribute list.
Report from CI
Send one request per deploy. Use this method when your agent’s model calls reach Morse only through an LLM gateway: gateway requests carry no commit, so Morse cannot read one from the runs.
curl -X POST https://api.morseai.dev/api/v1/deployments \
-H "Authorization: Bearer $MORSE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"git_sha":"<commit sha>","source_type":"deploy","idempotency_key":"<unique per deploy>"}'Authenticate with an environment ingest key. The report is recorded against that key’s environment, so use the production key for production deploys.
In GitHub Actions, add this step after your deploy:
- name: Report deploy to Morse
run: |
curl -X POST https://api.morseai.dev/api/v1/deployments \
-H "Authorization: Bearer ${{ secrets.MORSE_API_KEY }}" \
-H "Content-Type: application/json" \
-d '{"git_sha":"${{ github.sha }}","source_type":"deploy","idempotency_key":"${{ github.run_id }}-${{ github.run_attempt }}"}'Fields
Unknown fields are rejected. The body is limited to 4 KB.
| Field | Required | Rule |
|---|---|---|
git_sha | yes | 7 to 40 hexadecimal characters. |
source_type | yes | The string "deploy". |
agents | no | Up to 20 names of agents that already exist. Leave it out to report for every agent. |
version | no | Your own release label. Matches ^[A-Za-z0-9._-]{1,64}$. |
deployed_at | no | ISO 8601 time, within the last 7 days and no more than 5 minutes in the future. |
idempotency_key | no | Matches ^[A-Za-z0-9._:-]{1,64}$. A repeat with the same key returns the first result. |
Responses
| Status | Meaning |
|---|---|
| 202 | Accepted. |
| 200 | A repeat of an earlier report with the same idempotency_key. Nothing new is recorded. |
| 422 | Rejected. The body is {"error": {"code": "...", "message": "..."}}. |
| 429 | More than 30 reports per minute for this key. Wait for the Retry-After seconds. |
The 422 code is one of bad_sha, bad_source_type, unknown_agent, too_many_agents,
bad_version, bad_time, bad_idempotency_key, unknown_field, body_too_large or bad_body.
The 429 body carries the code rate_limited.
What a report does
A report on its own is Waiting for runs: Morse confirms it when runs with that commit arrive in that environment, within 24 hours. The deployment then reads Confirmed by CI and takes the report’s time as its deployed time. A report nobody confirms expires after 24 hours.
If your CI repeats the report for the commit that is already live, Morse matches it right away.
A report never creates a change. It only gives Morse a more exact deploy time.
Measuring a deploy
Once Morse has confirmed a deploy, it starts a before and after verdict for it. Nobody has to click Track it. Find it on Agent → Changes → Deploys. Each lane is its own result: cost per run, typical and slow-end response time, error rate and success rate. Lanes are never combined into one score, and a result says what changed before and after the deploy, not what caused it.
| State | Meaning |
|---|---|
| Measuring | Being measured. No lane has a result yet. |
| Verdict ready | At least one lane has a result. |
| Not measured | Not being measured. Measure this deploy starts it. |
Too early. A lane reads Too early until both sides of the deploy have enough runs: at least 100 runs and 72 hours on each side. An agent with little traffic can stay at Measuring for days. Morse shows what is still missing.
Setting. Measure every deploy automatically is on by default. Org owners and admins can turn it off in Settings → Integrations → Deploy tracking; deploys are then listed as Not measured until someone chooses Measure this deploy. It covers deploys only: a model, prompt or configuration change on the same commit still needs a person to track it.
Which environment a commit is recorded in
Morse never reads the environment from your code. It comes from the API key that sent the
runs or the CI report: every environment has its own key, so the same commit sent with the staging
key and with the production key is recorded as two separate deployments. Each workspace starts with
one environment, production. Add others such as staging and use each one’s key in that
deployment. A deployment.environment attribute on your traces is stored but never changes the
environment. See Environments.
Runs sent with a key that belongs to no environment show as No environment.
Where to see it
- Agent → Changes → Deploys is where deploys are read. One row per deploy, newest first, over 90 days: the commit, environment, when it went out, Live or Replaced, Rollback when it rolled back to an earlier commit, Confirmed by CI, and the before and after result (Measuring, Verdict ready with one chip per lane, or Not measured). “No change recorded for this commit” means the commit matches the one before, or change detection is off. Ignored revisions are not listed.
- Settings → Integrations → Deploy tracking is setup only: one summary line per environment with a View deploys link per agent, the Measure every deploy automatically switch and the setup methods above under Set up deploy tracking. Notes below show CI reports still waiting for runs (“Waiting for runs: CI reported 4db04aa in production 3h ago. Morse confirms it when runs with this commit arrive, within 24 hours”), revisions ignored in the last 30 days (behind Show ignored revisions) and the last report Morse rejected, with the reason.
- An agent’s page has a Deployments row in Setup health with its last deployment per environment, or No commit on this agent’s traces, linking to the Deploys panel or to setup.
- Home shows No deployments detected yet with a Set up deployments link until the first deployment is recorded.
- In demo mode, the Deploys panel and Settings → Integrations show sample deploys in every state.
Related
- Record keys and versions: the git revision lookup order, agent version and service version.
- Change Verdicts: where each deployment’s before and after comparison lives.
- OTLP: sending traces without the Morse SDK.