Skip to content

When something breaks

Mark deploys and read History

Add one line to the end of your deploy. From then on, every chart shows when each version went out, and History lists it beside everything else that happened.

At the end of your deploy, run:

Terminal window
kiyesi deploy --app checkout-api --version 3.8.1

Kiyesi records the app, the version and who shipped it. Who shipped it comes from your CI system (GitHub Actions, GitLab, Bitbucket, CircleCI, Buildkite or Drone), then the latest commit’s author, or --by "Ada Obi".

There are three ways to run the command, and a fourth needs none:

If the deploy runs on a connected server, kiyesi deploy uses that server’s own token. Nothing else to set up.

In the dashboard, open Settings, Deploy tokens, give the token a name, type a fresh authenticator code, and choose Make a token. It is shown once: save it in your CI as the secret KIYESI_DEPLOY_TOKEN. A deploy token can only mark deploys and ask whether it is safe to deploy (preflight). It can mark deploys only on what its maker can see. A token made by someone limited to some projects marks deploys of those projects and environments alone, and must name the project or server.

Then name the server, or the project when a deploy goes to several servers:

Terminal window
kiyesi deploy --app web --version "$GIT_SHA" --server web-prod
kiyesi deploy --app web --version "$GIT_SHA" --project Storefront --env production

After kiyesi login, name the server: kiyesi deploy --app web --version 1.4.0 --server web-prod. It needs Act on history and deploys: the Owner and Admin roles, or a role you made with it.

An app on Render, Heroku, Railway, Vercel or Netlify needs no command: the platform tells Kiyesi when each deploy succeeds, through the deploy address of its platform link. Each notice is marked once, however often the platform sends it, and checked against the platform’s signing secret when you give one. A GitHub deployment_status webhook works the same way.

With kiyesi on the runner, installed as on the quick start:

- name: Mark the deploy in Kiyesi
env:
KIYESI_DEPLOY_TOKEN: ${{ secrets.KIYESI_DEPLOY_TOKEN }}
run: kiyesi deploy --app checkout-api --version "${{ github.sha }}" --server checkout-api-prod

In the dashboard, open History. Everything that happened, newest first, grouped by day, for the last 90 days:

  • deploys, with the version and who shipped it;
  • new critical findings, and fixed ones;
  • grade changes;
  • container restarts, new images and processes killed for memory;
  • servers that stopped reporting and came back;
  • sites that stopped answering and came back;
  • incidents opened and fixed;
  • scheduled jobs that failed, were missed or ran long;
  • each deploy’s verdict;
  • servers disconnected, deleted and restored, and who did it.

Filter by time, server and kind. In a terminal:

Terminal window
kiyesi history --since yesterday
kiyesi history --server checkout-api-prod --since 7d
kiyesi deploys

Each person sees only the servers and projects their role lets them see.

Open All deploys of the last 30 days on the Latest deploy card and choose Remove (marked by mistake). The marker, its verdict, its lines in History and a roll-back alert it raised all go; the activity log keeps who removed it. It needs Manage on history and deploys: the Owner and Admin roles.

Terminal window
kiyesi deploys remove checkout-api 3.8.1-oops

Kiyesi watches each deploy for 10 minutes after it goes out, compares those minutes with the hour before, and says healthy or roll back, with the evidence:

What it looks at It says roll back when, after the deploy,
Failed requests at least doubled and reached 2% of requests, with at least 10 failures
Response time the slowest 5% of responses (p95) at least doubled and passed 500 ms
Restarts the app restarted again and again, or was killed for using too much memory
Memory reached 95% or more, from below 90% before
Browser errors 10 or more on the new version, at three times the rate before. Only for a frontend with the same name as the app
Incidents an incident opened whose source is this deploy or the frontend

With no requests and no errors to compare, it says not enough to judge rather than guess. When the app is a container, it is judged on its own restarts and memory, on the requests that name no site, and on the requests to the sites it serves; another site’s failures never count against it. A healthy verdict names the server’s sites that are linked to no container, whose requests it could not judge. Restarts in the first 3 minutes are the deploy itself and do not count. When the same app is deployed again within the 10 minutes, the first deploy is watched only until the second; if that is under 3 minutes, its verdict says it was replaced before it could be judged.

The verdict shows on History’s Latest deploy card, as a line in History, and in kiyesi deploys. A roll back also sends an alert with the command to roll back, built from the version deployed before it, such as IMAGE_TAG=2.13.4 docker compose up -d storefront-web. The alert closes when a later deploy of the same app is healthy.

From agent 0.46.0, Kiyesi reads which container serves each site from the web server in front of it. It only reads, and changes nothing:

  • Traefik: the traefik.http.routers.<name>.rule labels on a container, such as Host(`shop.example.com`) || Host(`www.shop.example.com`). The container with the label serves those sites.
  • caddy-docker-proxy: the caddy label on a container, such as caddy=shop.example.com beside caddy.reverse_proxy={{upstreams 8080}}.
  • Caddy: its live settings, read from its admin address on the server itself (127.0.0.1:2019), or else its Caddyfile (/etc/caddy/Caddyfile, or one mounted into a Caddy container). Each site’s reverse_proxy address is matched to a container.
  • nginx: each server_name and its proxy_pass, through upstream blocks, in /etc/nginx/nginx.conf, conf.d and sites-enabled.

An address such as api:3000 is matched to the container of that name, Compose service or network alias. An address on the server itself, such as localhost:3000, is matched to the container that publishes port 3000. An address that matches no container is left out.

On the server’s page, Sites and the container that serves them lists each site with its container and where the link came from: Read from Traefik, Read from Caddy, Read from nginx, or Set by your team. When a link is wrong or missing, choose Change beside the site, then a container, or Not served by a container here. A link set by your team is used instead of the one Kiyesi reads, until you choose Remove. Changing a link needs Manage on Servers and findings, and each change is in the activity log. The API is PUT /v1/servers/<id>/site-links with {"site": "shop.example.com", "container": "checkout-api"}; "container": null removes your team’s link.

Before a deploy, Kiyesi checks six things it already knows about the server and answers go or wait, with what to do first:

Check Waits when
Memory 90% or more is used, or the app was killed for using too much memory on the latest scan
Disk 90% or more is used
Backup The backup check found anything: no backup set up, none written, older than expected, would not restore, or much smaller than the last
Certificate A certificate has expired (critical). One about to expire is shown, but does not make it wait
Open incident An incident on this server is not fixed
Last deploy Its verdict was roll back

A server that sent no memory or disk figures in the last 5 minutes makes it wait: it may be down or full. Anything else not known, such as a server not scanned yet, never does. It only advises: it never stops a deploy by itself. On History, Before the next deploy shows the answer for any server. In a terminal, or in a pipeline before the deploy step:

Terminal window
kiyesi preflight checkout-api-prod

It exits with 0 for go and 1 for wait. In CI, set KIYESI_DEPLOY_TOKEN: a deploy token may ask about any server in its team, and gets the answer and its reasons, nothing more. Run on a connected server with no name, it checks that server.