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. Every refresh, 30 seconds by default, it reads the whole stash again to catch anything a dropped 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โ€‹

Each key that is set or deleted goes on the ticker in yellow, such as stash set Billing / Development ยท md/v1/health = degraded. Its environment ripples and raises ๐Ÿ“Œ for a key that is set or ๐Ÿ—‘ for one that is deleted, or the key itself with --flashes words. A key that changes again replaces its own line on the ticker, so a script that writes every second does not fill the ticker.

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, and ? says why. 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.