Skip to main content

Stash and Annotations

Alpha

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 viewHow the stash is read
Personal access token, 20 or fewer environments in viewStreamed. Each key shows the moment it is set.
Service accountRead every --stash interval, 3 seconds by default
A stream is reconnectingRead every --stash interval until every stream is back
More than 20 environments in viewRead 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:

KeyFlashOn 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.

KeySet onIn Massdriver Constellation
md/v1/healthInstanceThe 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/usageInstanceA bar under the instance in the side panel, such as โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘ 82/100 connections. Amber from 80%, red from 95%.
md/v1/trafficInstanceThe 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/bannerEnvironmentA banner across the top of the map, a โš‘ next to the environment, and the message in the side panel, colored by level
md/v1/linksEnvironmentLinks 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, and destination. Markdown becomes plain text, links keep their text, and images are dropped.
A note pinned toShows in the side panel
A projectUnder the banner of each of the project's environments
An environmentUnder its banner
An instance or a componentUnder the instance
A lineUnder 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.