Skip to content
81 changes: 81 additions & 0 deletions docs/guides/dashboard/01-overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
id: guides-dashboard-overview
slug: /guides/dashboard
title: Massdriver Constellation
sidebar_label: Overview
---

# Massdriver Constellation

:::caution Alpha
This feature is alpha. Names, fields, and behavior can change or be removed at any time without notice.
:::

Massdriver Constellation is a live map of your organization in the terminal. It shows your environments, the resources they share, what is firing, what is deploying, what is waiting for approval, what can upgrade, and what your deployments and scripts write to the stash, as it happens. You can approve, reject, and redeploy from it, follow a deployment's logs, and write up an incident when one ends.

Massdriver Constellation runs in your terminal with `mass dashboard`. The command is not in a released version of `mass` yet. It will be available in a future `mass` release.

## Quick start

To learn what everything on the map means first, take the tutorial. It runs on a made-up organization, needs no profile, and reads nothing from Massdriver:

```bash
mass dashboard --tutorial
```

Then open your own organization:

```bash
mass dashboard
```

The map centers on the environment with your organization's most recent deployment. To center on a specific environment, name it:

```bash
mass dashboard --env billing-dev
```

Use a profile the same way as every other `mass` command:

```bash
mass dashboard --profile production
```

To look without being able to change anything, turn off approving, rejecting, and deploying:

```bash
mass dashboard --read-only
```

Press `?` on any tab to see what the marks and keys mean. Quit with `q` or `ctrl+c`.

## The screen

![Massdriver Constellation centered on an environment, with its instances in the side panel](/img/screenshots/constellation-constellation.png)

From top to bottom:

| Part | What it shows |
|---|---|
| Header | Your organization, the five tabs, and counts for what is in view: environments, projects, monthly cost, upgrades, deployments in flight, when the organization was last read, and how many instances are alarming |
| Map | The environment in focus and the environments around it. A banner from the stash runs across its top line. |
| Side panel | The selected environment: its instances, alarms, deployments, banner, links, notes, neighbors, and blast radius, or the logs of a deployment you follow. It hides on terminals narrower than 90 columns. |
| Ticker | The newest events from the audit log and the stash, newest first |
| Key line | The keys that do something where you are: on the tab, for the picked instance, for the selected deployment, or in the logs you follow. `?` lists every key. Messages such as "✓ approved …" show here for a few seconds. |

## Tabs

| Key | Tab | What it shows |
|---|---|---|
| `1` | Constellation | The map. See [Reading the map](/guides/dashboard/reading-the-map). |
| `2` | Runtimes | Which runtime versions your applications build on and your instances run, and what a release would leave behind |
| `3` | Alarms | Every firing alarm in view, and how far its blast radius reaches |
| `4` | Upgrades | Every instance in view that can move to a newer bundle version |
| `5` | Deployments | Deployments awaiting approval, in flight, and recently finished, to approve, reject, inspect, or follow |

## Where to go next

- [Tour](/guides/dashboard/tour) walks through Massdriver Constellation one feature at a time, against your own organization.
- [Reading the map](/guides/dashboard/reading-the-map) covers every mark, color, and animation, and the four themes.
- [Stash and annotations](/guides/dashboard/stash-and-annotations) covers the widgets and notes your deployments and scripts write.
- [Reference](/guides/dashboard/reference) lists every flag and key.
356 changes: 356 additions & 0 deletions docs/guides/dashboard/02-tour.md

Large diffs are not rendered by default.

189 changes: 189 additions & 0 deletions docs/guides/dashboard/03-reading-the-map.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
---
id: guides-dashboard-reading-the-map
slug: /guides/dashboard/reading-the-map
title: Reading the Map
sidebar_label: Reading the Map
---

# Reading the Map

:::caution Alpha
This feature is alpha. Names, fields, and behavior can change or be removed at any time without notice.
:::

Press `?` on the map for a short legend in the side panel.

## What is in view

The map holds one neighborhood of your organization, not all of it:

- **The focus.** The environment named with `--env`, or else the environment of the most recent deployment.
- **Its neighbors**, out to `--depth` hops (1 by default). A neighbor is an environment whose resources an instance uses, an environment that uses this environment's resources through a remote reference or an environment default, or the environment this one was forked from.

| Label | Meaning |
|---|---|
| 🔭 | One hop past the edge. An environment in view links to it. Select it to move the focus there and bring it into view. |
| **no access** | An instance in view uses a resource from this environment, but you cannot view the environment. |

The focus moves when a selection rests for a moment, when you press `enter`, and when a search moves it. Every node glides from its old place to its new one, and the environments around the new focus come into frame.

## What moves

| Mark | Meaning |
|---|---|
| Sparks along a link | Resources flowing from the environment that produces them to the environment that uses them. With traffic from `md/v1/traffic`, the rate sets how many sparks run and how fast. |
| Red or amber sparks | Errors on the link: amber for 1 to 9, red for 10 or more |
| Ring around an environment | The environment's instances by status, as arcs: green provisioned, red failed, blue not deployed, gray decommissioned |
| Red pulse | An alarm is firing in the environment |
| Comet around a ring | A provision or decommission is running or queued. A plan does not count. |
| Ripple with a rising flash | Something just happened there: an audit log event or a stash change. See [Flashes](#flashes). |
| Spinning white and teal halo | The selected environment |
| Closing rings and crosshairs | `--watch` just took the view to a new alarm |
| Twinkling stars, falling streams, or a grid | The palette's backdrop |

## Flashes

Where something happens, the environment ripples and a flash rises over it. By default the flash is an emoji:

| Flash | What happened |
|---|---|
| 🚀 | A deployment started |
| ✅ | A deployment completed, or an alarm cleared |
| 💥 | A deployment failed |
| 🛑 | A deployment was aborted |
| 📝 | A deployment was proposed |
| 👍 | A deployment was approved |
| 👎 | A deployment was rejected |
| 🚨 | An alarm fired |
| 🩺 | An instance's health changed (`md/v1/health`) |
| 📊 | An instance's usage changed (`md/v1/usage`) |
| 📈 | An instance's traffic changed (`md/v1/traffic`) |
| 📣 | An environment's banner changed (`md/v1/banner`) |
| 🔗 | An environment's links changed (`md/v1/links`) |
| 🗑 | A stash key that a widget draws was deleted |
| 🛠 | An instance changed |
| 🌍 | An environment or project changed |
| ✨ | Anything else |

A stash change rises as what its key measures. A widget you pin to any other key rises as the widget it draws, so a pinned health widget rises as 🩺. Only keys a widget draws, well-known or pinned, rise or reach the ticker. A script's other keys stay quiet. See [The stash feed](/guides/dashboard/stash-and-annotations#the-stash-feed).

The ticker leads each event with the same emoji.

`--flashes` chooses what rises, and what leads each line on the ticker:

| Value | Flash |
|---|---|
| `emoji` | The emoji for the event. The default. |
| `words` | The event's name, such as `deployment completed` |
| `off` | Nothing rises, and the ripple still shows. The ticker keeps its emoji. |

```bash
mass dashboard --flashes words
```

## Lines

| Line | Meaning |
|---|---|
| Solid | The environment at the end uses resources from the environment at the start |
| Dashed | The environment was forked from the one at the other end |
| `1.2k/s 340ms ✕12` | Requests per second, p95 latency, and errors in the last 5 minutes, from `md/v1/traffic` |
| `stale` | No traffic report for 10 minutes |

## Badges and labels

| Mark | Meaning |
|---|---|
| `▲N` | N alarms firing |
| `↑N` | N instances can upgrade |
| `⚑` | The environment has a banner |
| `◆` | An application instance |
| `◌` | An environment you cannot view |
| `✎` | A note |
| Banner across the top line | The selected environment's banner, or else the most urgent banner in view: error, then warning, then info |

![The ? legend beside the map](/img/screenshots/constellation-legend.png)

## Blast radius

With blast radius on (`b`), everything downstream of the selected environment lights up by how many hops away it is:

| Color | Hops |
|---|---|
| Red | The source |
| Orange | 1 hop |
| Yellow | 2 or more hops |

The links between them take the same colors. When the selected environment has a firing alarm, the blast radius starts at the alarming instance rather than the whole environment.

## Themes

`--theme` sets how the map is drawn, and `v` switches themes while Massdriver Constellation runs, in this order:

![The metro theme](/img/screenshots/constellation-theme-metro.png)

![The radar theme](/img/screenshots/constellation-theme-radar.png)

![The plain theme](/img/screenshots/constellation-theme-plain.png)

| Theme | Layout | How links are drawn |
|---|---|---|
| `constellation` | A force layout. Environments that share resources pull together, and the focus holds the center. | Curved lines with sparks |
| `metro` | A band for each project, and a column for each layer of producers, so resources flow left to right | Track drawn with box characters, with sparks running down it. Each project's line has its own color. |
| `radar` | The focus at the center of a scope. Each environment sits on the ring as many hops out as it is, and environments the focus cannot reach sit on the edge. | Straight lines. A sweep turns around the scope, and blips light up as it passes them. |
| `plain` | Environments listed by project, one line each, in columns that fill the width of the map | No links. Nothing moves except the dot of an environment that is deploying. |

In `metro`, a station shows as `◉` in its environment's health color. It blinks red while an alarm fires and spins while a deployment runs.

In `plain`, each project is a heading in its own color, and each environment is one line: a dot in its health color, its name, and then what applies to it.

| On a `plain` line | Meaning |
|---|---|
| Spinning blue dot | A deployment is running |
| 🔭 in place of the dot | One hop past the edge |
| `◌` and **no access** | You cannot view the environment |
| `▲ N alarming` | N alarms firing |
| `⟳ N deploying` | N instances deploying |
| `✕ N failed` | N instances failed |
| `N/M up` | N of the environment's M instances are provisioned |
| `↑ N` | N instances can upgrade |
| `⚑` | The environment has a banner, colored by its level |
| `$1.2k/mo` | Last month's spend, with cost on (`c`) |

The arrow keys move the selection from line to line, and the blast radius colors the names of the environments it reaches.

## Palettes

`--palette` sets the colors and the backdrop, and `p` switches palettes while Massdriver Constellation runs. Red, orange, and yellow mean alarms, warnings, and the blast radius in every palette.

![The blueprint palette](/img/screenshots/constellation-palette-2.png)

![The rain palette](/img/screenshots/constellation-palette-3.png)

| Palette | Backdrop |
|---|---|
| `night` | A starfield |
| `rain` | Falling green streams |
| `blueprint` | A drafting grid |

## Braille or blocks

The map is drawn with braille dots by default, which works in any terminal. `--render blocks` fills the dots in as solid blocks, so links and rings draw as solid lines rather than dotted ones. It looks best in a terminal that draws block characters itself, such as Ghostty.

```bash
mass dashboard --render blocks
```

## Toggles

| Key | Toggle |
|---|---|
| `b` | Blast radius |
| `a` | Instances as dots around each environment. Applications are larger dots. |
| `c` | Rings sized by last month's spend, and the spend under each name |
| `g` | Project names colored by project, and each project's environments pulled together |
| `s` | Producers stacked above the environments that use their resources |
| `v` | The next theme |
| `p` | The next palette |

Pressing `b`, `a`, `c`, `g`, or `s` shows all five toggles on the bottom line for a few seconds, each with `●` when it is on and `○` when it is off.
111 changes: 111 additions & 0 deletions docs/guides/dashboard/04-stash-and-annotations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
---
id: guides-dashboard-stash-and-annotations
slug: /guides/dashboard/stash-and-annotations
title: Stash and Annotations
sidebar_label: Stash and Annotations
---

# Stash and Annotations

:::caution 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](/guides/annotations/widgets) and [notes](/guides/annotations/notes) as the Massdriver canvas, from the same [stash](/guides/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`:

```bash
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](#widgets-from-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](/guides/stash/well-known-keys) 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:

```bash
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 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.
Loading