Stash and Annotations
This feature is alpha. Names, fields, and behavior can change or be removed at any time without notice.
Massdriver Constellation draws the same widgets and notes as the Massdriver canvas, from the same stash entries.
The stash feedโ
Massdriver Constellation reads the stash of every project, environment, component, and instance in view once, then streams each key as it is set or deleted. It opens one stream for each environment in view, and moves them when the view moves. Each time it reads the map or the status of what is in view, and whenever a dropped stream comes back, it reads the whole stash again to catch anything a stream missed.
Streaming or pollingโ
| Profile or view | How the stash is read |
|---|---|
| Personal access token, 20 or fewer environments in view | Streamed. Each key shows the moment it is set. |
| Service account | Read every --stash interval, 3 seconds by default |
| A stream is reconnecting | Read every --stash interval until every stream is back |
| More than 20 environments in view | Read every --stash interval |
Change the interval with --stash:
mass dashboard --stash 1s
Each read covers every stash in view, so a shorter interval costs more requests. --stash 0 reads the stash only with each refresh.
On the map and the tickerโ
Only keys that a widget draws are news: the well-known keys, and any key a widget you pinned reads. When one is set or deleted, its environment ripples, a flash rises over it, and a line lands on the ticker. Every other key, such as a script's own bookkeeping, stays quiet. It is still read, and a note or pinned widget that uses it still shows it.
The ticker draws the new value the way its widget looks, without the key:
| Key | Flash | On the ticker |
|---|---|---|
md/v1/health | ๐ฉบ | A dot in the health's color and the health, such as โ degraded |
md/v1/usage | ๐ | A small bar and the usage, colored like the side panel's bar |
md/v1/traffic | ๐ | The rate, errors, and p95 latency, such as 1.2k/s ยท โ12 ยท 340ms |
md/v1/banner | ๐ฃ | โ and the message, colored by level |
md/v1/links | ๐ | ๐ and the names of the links, such as ๐ Grafana, Runbook |
A key a widget you pinned reads rises and draws as that widget. A deleted key rises as ๐ and shows the key's name, dimmed. If a widget can't draw its value, for example a pinned widget missing an input, the value shows as text, and a JSON value as its fields, such as max: 0 ยท value: 1.
A full line reads like 2s ๐ฉบ Billing / Development ยท โ degraded. With --flashes words, the event's name, stash set, leads the line instead of the emoji. A key that changes again replaces its own line on the ticker, so a script that writes every second does not fill the ticker.
The audit log also records stash changes. The ticker leaves those out, because the stash feed already shows them.
When a read fails for one project, that project keeps the entries from the last read that worked. Nothing is reported as deleted.
Widgets from well-known keysโ
A well-known key draws its widget for everyone who can view the project. Well-known keys start with md/ and carry their version in the key, as in md/v1/health. Each one can be set only on its kind of entity, with its format, and with a value that matches its schema. An md/ key that is not well-known is rejected.
| Key | Set on | In Massdriver Constellation |
|---|---|---|
md/v1/health | Instance | The instance's dot, and its health in the side panel: green for healthy, ok, or up; amber for degraded, warning, or recovering; red for down, failed, or error; gray for anything else. A red instance blinks on the map. |
md/v1/usage | Instance | A bar under the instance in the side panel, such as โโโโโโโโโโ 82/100 connections. Amber from 80%, red from 95%. |
md/v1/traffic | Instance | The links that leave the environment carry the rate, p95 latency, and errors, and the sparks follow the rate. A rate of 0 shows no sparks. |
md/v1/banner | Environment | A banner across the top of the map, a โ next to the environment, and the message in the side panel, colored by level |
md/v1/links | Environment | Links under the environment's name in the side panel. Only http and https links show. |
For example:
mass stash set billing-dev-app.md/v1/health degraded
mass stash set billing-dev-app.md/v1/usage '{"value": 37, "max": 100, "label": "connections"}' --format json
mass stash set billing-dev-app.md/v1/traffic '{"rps": 240, "errors_5m": 2, "p95_ms": 85}' --format json
mass stash set billing-dev.md/v1/banner '{"message": "Deploy freeze until Friday", "level": "warning"}' --format json
mass stash set billing-dev.md/v1/links '{"links": [{"label": "Runbook", "url": "https://wiki.example.com/billing"}]}' --format json
Traffic counts toward a link when the instance that the link leaves sets md/v1/traffic. A link between two environments adds up the traffic of each instance in the first environment that sends on it. Traffic that has not been reported for 10 minutes shows as stale.
Rejection reasonsโ
When you reject a deployment with x on the Deployments tab and type a reason, the reason is kept as text in that deployment's stash under review/rejection. The deployment API takes no message for a rejection, so the stash is where the reason lives.
If the reason cannot be saved, the deployment is still rejected, and the footer says the reason was not saved.
Your annotationsโ
Massdriver Constellation also shows the annotations you pin in the web app:
- Widgets you pin read any stash key, not only the well-known ones, including a field of a JSON entry and a number written as text. A widget you pin replaces the automatic widget in the same spot. If yours has no value, the automatic one shows.
- Notes render their Liquid template with the same namespaces as the canvas:
project,environment,component,instance,source, anddestination. Markdown becomes plain text, links keep their text, and images are dropped.
| A note pinned to | Shows in the side panel |
|---|---|
| A project | Under the banner of each of the project's environments |
| An environment | Under its banner |
| An instance or a component | Under the instance |
| A line | Under NOTES ON LINKS, with the two instances it joins |
A note that does not render shows the template's error in its place. A note that takes too long to render is cut off.
Annotations need a personal access tokenโ
Only you can see your annotations, and service accounts cannot have them. When you run Massdriver Constellation with a profile that signs in as a service account, notes and pinned widgets do not show. Automatic widgets from well-known keys still show. Use a profile with your personal access token to see your annotations.
Text from the stashโ
Massdriver Constellation removes control characters, bidirectional overrides, and directional marks from text it reads from the stash, from notes, and from deployments, so a value cannot change your terminal or disguise itself.