diff --git a/docs/guides/dashboard/01-overview.md b/docs/guides/dashboard/01-overview.md new file mode 100644 index 00000000..33f68241 --- /dev/null +++ b/docs/guides/dashboard/01-overview.md @@ -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. diff --git a/docs/guides/dashboard/02-tour.md b/docs/guides/dashboard/02-tour.md new file mode 100644 index 00000000..9cc2f8cf --- /dev/null +++ b/docs/guides/dashboard/02-tour.md @@ -0,0 +1,356 @@ +--- +id: guides-dashboard-tour +slug: /guides/dashboard/tour +title: Tour +sidebar_label: Tour +--- + +# Tour + +:::caution Alpha +This feature is alpha. Names, fields, and behavior can change or be removed at any time without notice. +::: + +This tour uses your own organization. Some steps write to the stash, approve or reject a deployment, or start one, so pick an environment you can change, for example a development environment. The examples use `billing-dev` and its instance `billing-dev-app`. Put your own ids in their place. + +Use a terminal at least 120 columns wide, so the side panel shows next to the map. + +## 1. New to the map? Start here + +```bash +mass dashboard --tutorial +``` + +![The tutorial explaining the constellation](/img/screenshots/constellation-tutorial-1.png) + +The tutorial walks through what everything on the map means, one thing at a time, on a made-up organization that shows every state at once: rings, instances, alarms, deployments, the selection, sparks, forks, the blast radius, upgrades, banners, notes and links, ๐Ÿ”ญ, no access, flashes, the ticker, the side panel, and the keys. It needs no profile and reads nothing from Massdriver. + +| Key | What it does | +|---|---| +| `โ†’`, `space`, `enter` | Next step | +| `โ†` | Previous step | +| `q`, `esc` | Quit | + +Past the last step, the made-up organization is yours to explore with every key in this tour. `--palette`, `--render`, and `--flashes` work with `--tutorial`. `--theme`, `--watch`, `--read-only`, `--env`, `--depth`, and `--playback` do not. + +## 2. Open the map + +```bash +mass dashboard --env billing-dev +``` + +The environments fly out from the center into place, and then the links between them draw in. `billing-dev` sits in the middle with a spinning white and teal halo, because it is both the focus and the selection. + +The header counts what is in view. The map does not hold your whole organization. It holds `billing-dev`, the environments whose resources it uses, the environments that use its resources, and the environment it was forked from. That is one hop. Read further out with `--depth`: + +```bash +mass dashboard --env billing-dev --depth 2 +``` + +Environments one hop past the edge show dimmed, with a ๐Ÿ”ญ under the name. Environments you cannot view show as **no access**. + +The key line at the bottom shows only the keys that do something where you are. Press `?` to see every key, and what each mark and color means, in the side panel. Press `?` or `esc` to close it. + +## 3. Move around + +Press the arrow keys, or `h`, `j`, `k`, and `l`. The selection jumps to the nearest environment in that direction. `tab` and `shift+tab` step through every environment, top to bottom. + +The side panel follows the selection. It lists the environment's instances with their health, firing alarms, running deployments, and deployments awaiting approval (`โธ`), then the environments it uses resources from and the ones it feeds, and its blast radius. + +Rest on an environment for a moment. It becomes the new focus. The map reads what is around it, every node glides to its new place, and environments that were past the edge come into frame from the new focus. Select a ๐Ÿ”ญ environment to bring it in. Press `enter` to move the focus at once. + +## 4. Find an environment + +Press `/` and type part of a name, an id, a project, or an instance id. The selection jumps to the first match in view, and the other environments dim. + +![Searching for an environment by name](/img/screenshots/constellation-search.png) + +Press `enter`. When nothing in view matches, Massdriver Constellation searches every environment in your organization and moves the focus to the best match: an exact id first, then an id that starts with your text, then any name, id, or project that contains it. + +Press `esc` to clear the search. + +## 5. Follow the resources + +Each link is drawn from the environment that produces a resource to the environment that uses it. Sparks run along each link in that direction. A link with more resources carries more sparks. + +Press `b` to turn the blast radius on or off. With it on, everything downstream of the selected environment lights up: red at the source, orange one hop away, and yellow further out. When the selected environment has a firing alarm, the blast radius starts at the alarming instance, not the whole environment. + +Turn on more detail: + +| Key | What it adds | +|---|---| +| `a` | Each instance as a dot around its environment. Applications are larger dots. | +| `c` | Each ring 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 | + +Each of these keys flips its toggle and shows where all five stand on the bottom line for a few seconds, such as `blast โ— ยท apps โ—‹ ยท cost โ—‹ ยท projects โ—‹ ยท producers on top โ—‹`. + +## 6. Change how it looks + +Press `v` to switch themes: + +- **constellation** scatters environments like stars, pulled together by the resources they share. +- **metro** draws environments as stations on transit lines: a band for each project, producers on the left, and sparks running down the track to their consumers. +- **radar** puts the focus at the center of a sweeping scope, with each environment on the ring as many hops out as it is. Blips light up as the sweep passes them. +- **plain** lists environments by project, one line each, with their health, alarms, deployments in flight, failed instances, how many instances are up, upgrades, and banner. Nothing moves except the dot of an environment that is deploying. It is the quickest read of what is healthy and what needs a look. + +Press `p` to switch palettes: `night`, `rain`, and `blueprint`. Start in a theme and palette with `--theme` and `--palette`: + +```bash +mass dashboard --theme radar --palette rain +mass dashboard --theme plain +``` + +The map draws its dots in braille by default, which works in any terminal. In a terminal that draws block characters itself, such as Ghostty, fill the dots in as solid blocks so links and rings draw as solid lines: + +```bash +mass dashboard --render blocks +``` + +Press `v` until you are back on `constellation` for the rest of the tour. + +## 7. Write to the stash and watch it land + +Massdriver Constellation streams the stash, so each key shows the moment it is set. Streaming needs a personal access token. With a service account, the stash is read every 3 seconds instead. See [The stash feed](/guides/dashboard/stash-and-annotations#the-stash-feed). + +Open a second terminal and set a few [well-known keys](/guides/stash/well-known-keys): + +```bash +mass stash set billing-dev-app.md/v1/health degraded +``` + +`billing-dev` ripples and a ๐Ÿฉบ rises out of it. The ticker draws the change the way the widget looks, without the key: `๐Ÿฉบ Billing / Development ยท โ— degraded`, with the dot in amber. In the side panel, the instance's dot turns amber too. Start with `--flashes words` to see the event's name in both places instead of the emoji. + +Only keys that a widget draws reach the ticker or rise over the map. Set a key of your own: + +```bash +mass stash set billing-dev-app.build-number 1234 +``` + +Nothing happens on the map or the ticker, because no widget draws `build-number`. Pin a widget to it in the web app, and its changes show like a well-known key's. + +Give the instance some traffic: + +```bash +mass stash set billing-dev-app.md/v1/traffic '{"rps": 1200, "errors_5m": 12, "p95_ms": 340}' --format json +``` + +The links that leave `billing-dev` pick up a label like `1.2k/s 340ms โœ•12`. The sparks speed up, and some turn red, because 10 or more errors is many. With 1 to 9 errors they turn amber. A ๐Ÿ“ˆ rises, and the ticker shows `1.2k/s ยท โœ•12 ยท 340ms`. + +Put up a banner and some links: + +```bash +mass stash set billing-dev.md/v1/banner '{"message": "Ledger failover test tonight", "level": "warning"}' --format json +mass stash set billing-dev.md/v1/links '{"links": [{"label": "Grafana", "url": "https://grafana.example.com"}]}' --format json +``` + +The banner runs across the top of the map in amber, and a โš‘ appears next to `billing-dev`. `โ†— Grafana` appears under the environment's name in the side panel. In terminals that support links, such as iTerm2, Ghostty, WezTerm, and kitty, you can click it. On the ticker, the banner arrives as ๐Ÿ“ฃ with `โš‘ Ledger failover test tonight`, and the links as ๐Ÿ”— with `๐Ÿ”— Grafana`. + +Show a usage bar: + +```bash +mass stash set billing-dev-app.md/v1/usage '{"value": 86, "max": 100, "label": "connections"}' --format json +``` + +The bar is amber from 80% and red from 95%. A ๐Ÿ“Š rises, and the ticker draws a small bar of its own. + +Set the health back when you are done: + +```bash +mass stash set billing-dev-app.md/v1/health healthy +``` + +See [Stash and annotations](/guides/dashboard/stash-and-annotations) for every widget, and for the notes and widgets you pin yourself. + +## 8. Follow a deployment's logs + +Select `billing-dev` and press `f`. The side panel widens to just over half the screen and follows the logs of the deployment running in the environment, or else its most recent one. On a terminal narrower than 90 columns, the logs take the whole screen. + +![A deployment's logs in the side panel](/img/screenshots/constellation-logs.png) + +The panel's heading names the instance, the action, and the status. Lines stream in as the deployment writes them. A long line wraps, and the rest of it is indented under the first part. When the deployment ends, the panel keeps its final status: `โœ“ completed`, `โœ• failed`, `โœ• aborted`, or `โœ• rejected`. + +Streaming logs needs a personal access token. With a service account, the logs are read every 2 seconds instead. + +Scroll back through the logs: + +| Key | What it does | +|---|---| +| `pgup`, `ctrl+u` | Back a page | +| `pgdown`, `ctrl+d` | Forward a page | +| `shift+โ†‘`, `shift+โ†“` | Back or forward a line | +| `home` | Show the logs from the first line | +| `end`, `G` | Go to the newest line and follow it again | + +While you are scrolled back, the heading shows `โ†‘ N lines back ยท end follows`, and new lines keep arriving without moving what you are reading. + +Press `f` or `esc` to close the logs. With the logs open, `esc` closes only the logs and leaves the rest of the view as it is. Moving the selection or switching tabs closes them too. + +## 9. Approve and deploy from the map + +An instance in the side panel shows `โธ awaiting approval` when it has a proposed deployment. + +1. Press `n` to pick the first instance in the side panel. Press `n` again for the next one, or `N` for the one before. The picked instance is highlighted, and the key line shows what you can do with it: `y approve app` when it has a deployment awaiting approval, and `d deploy app` unless it is already deploying. Press `esc` to unpick it. +2. Press `y` to approve the picked instance's deployment awaiting approval, or `d` to deploy it again with its current configuration. +3. A box asks first. It names the instance and its environment, what you are about to do, and how many environments and instances depend on it downstream. +4. Press `y` or `enter` to go ahead. Any other key cancels. When approving, press `c` first to see the deployment's configuration, then `esc` to come back to the box. + +The footer says what happened, such as `โœ“ approved billing-dev-app` or `โŸณ deploying billing-dev-app`, and the map reads the organization again. A deployment you start with `d` is a provision with the message "Deployed from mass dashboard". `d` does nothing for an instance that is already deploying. + +To leave these keys off, for example on a shared screen, start with `--read-only`: + +```bash +mass dashboard --read-only +``` + +## 10. Decide deployments on the Deployments tab + +Press `5`. The tab lists the deployments of the instances in view, in three sections: + +![The Deployments tab with one deployment awaiting approval](/img/screenshots/constellation-deployments.png) + +![A proposed deployment's configuration compared with the last provision](/img/screenshots/constellation-deployment-config.png) + +| Section | Each row | +|---|---| +| **Awaiting approval** | `โธ`, the instance, its environment, the action, who proposed it, how long ago, and the first line of its message | +| **In flight** | `โŸณ`, the instance, its environment, the action, its status, and how long it has run | +| **Recent** | `โœ“` or `โœ•`, the instance, its environment, the action, its status, how long it took, how long ago, and who ran it. The 20 most recent to finish, dimmed. | + +Use `โ†‘` and `โ†“` to pick a deployment. + +Press `c` to see its configuration: the action, status, who deployed it and when, the bundle version, the message, and each param it changes since the instance's last completed provision. `+` marks a param it adds, `-` one it removes, and `~` one it changes. Anything that looks like a secret shows as `โ€ขโ€ขโ€ขโ€ขโ€ขโ€ข`. Scroll with `โ†‘` and `โ†“`, and close the box with `esc`. + +Press `y` to approve a deployment awaiting approval. The same box as on the map asks first, and `c` in it shows the configuration before you decide. + +Press `x` to reject one. Type a reason if you want one, up to 200 characters, and press `enter`. `esc` cancels. The deployment API takes no message for a rejection, so the reason is kept in the deployment's stash under `review/rejection`. If the reason cannot be saved, the deployment is still rejected and the footer says so. + +Only a deployment awaiting approval can be approved or rejected, so the key line shows `y` and `x` only when one is selected. `--read-only` turns off `y` and `x` here too. + +The other keys on this tab: + +| Key | What it does | +|---|---| +| `enter` | Show the deployment's environment on the map, with its blast radius | +| `o` | Open the deployment's instance in the Massdriver web app | +| `f` | Follow its logs across the whole screen. `f` or `esc` closes them. | + +## 11. Check your runtimes + +Press `2`. Each runtime has a bar that shows how its instances split across runtime versions: green on the latest version, yellow a patch behind, orange a minor behind, and red a major behind. + +![The Runtimes tab](/img/screenshots/constellation-runtimes.png) + +Use `โ†‘` and `โ†“` to pick a runtime. Press `p`, `m`, or `M` to see what a patch, minor, or major release would leave behind. Press `0` to go back. + +## 12. Find what is firing and what can upgrade + +Press `3` for every firing alarm in view, with how long it has fired and how much depends on its instance. Press `4` for every instance that can move to a newer bundle version. + +![The Upgrades tab](/img/screenshots/constellation-upgrades.png) + +On either tab, press `enter` to show the selected row on the map with its blast radius, or `o` to open its instance in the Massdriver web app. + +## 13. Replay the last hour + +Press `1` to go back to the map, then press `t`. Pick how far back to go with `โ†` and `โ†’`, from 5 minutes to 24 hours, and press `enter`. + +![Choosing how far back to replay](/img/screenshots/constellation-replay-picker.png) + +![A replay running on the map](/img/screenshots/constellation-replay.png) + +The audit log plays back onto the map in order. Each event ripples its environment and raises its flash, such as ๐Ÿš€ for a deployment starting. The ticker shows the time being replayed and a progress bar. Press `]` to speed up, `[` to slow down, and `space` to pause. Press `t` to stop. + +A replay of any window finishes in under a minute at its starting speed. + +## 14. Leave it on a screen + +```bash +mass dashboard --watch +``` + +With `--watch`, Massdriver Constellation reacts to a new alarm on its own: + +1. It switches to the map and selects the alarm's environment. +2. Rings and crosshairs close in on the environment, and its blast radius lights up. +3. A red banner across the top names the alarm, its instance, its environment, and how much is downstream, and counts how long it has fired. +4. The terminal rings its bell and shows a desktop notification. + +Press `esc` to put the banner away. When the alarm clears, the banner turns green and says how long it lasted. A few seconds later, the view goes back to where it was, unless you moved it during the incident. + +Alarms that were already firing when Massdriver Constellation started do not count as new. + +## 15. Write up an incident and play it back + +Press `w` on the map or on the Alarms tab. The write-up of the incident behind the selected alarm or environment, or else the most recent incident, opens between the header and the key line, rendered from markdown. Nothing is written to disk until you save. + +![An incident write-up rendered in the terminal](/img/screenshots/constellation-writeup.png) + +![Editing the write-up as markdown](/img/screenshots/constellation-writeup-edit.png) + +The write-up has when the incident started and resolved and how long it lasted, the alarm and its message, its blast radius, a timeline of the deployments, alarms, and stash changes in that blast radius from shortly before it fired until it cleared, and sections for the root cause and follow-ups. It ends with the command that plays it back. + +Read it: + +| Key | What it does | +|---|---| +| `โ†‘` `โ†“`, `j` `k`, `pgup`, `pgdown` | Scroll | +| `g`, `home` | Go to the top | +| `G`, `end` | Go to the bottom | + +Press `e` to edit the markdown, for example to fill in the root cause and follow-ups. Press `esc` to go back to reading the rendered text. The heading shows `โ— unsaved` while you have changes that are not saved. + +Press `ctrl+s`, while reading or editing, to save two files to the current directory, named for the alarmed instance, the alarm, and the minute the incident started, in UTC: + +```text +incident-billing-dev-app-cpu-high-20261126-1402.md +incident-billing-dev-app-cpu-high-20261126-1402.json +``` + +The markdown file is the write-up. The JSON file is a recording: the environments in view when the alarm fired, their stash, and that timeline. Saving again replaces both files. Both are readable only by you, because stash values and alarm messages can be sensitive. + +Press `q` or `esc` to close the write-up. With unsaved changes, it asks `discard changes? y/n` first: `y` discards them, and any other key keeps them. Open the same incident again with `w` before you quit, and it shows the text you last saved. + +Play a recording back, offline: + +```bash +mass dashboard --playback incident-billing-dev-app-cpu-high-20261126-1402.json +``` + +Massdriver Constellation opens on the recording and replays it on the map. `space` pauses, and `[` and `]` change the speed. Nothing is read from or sent to Massdriver, so approving, rejecting, deploying, and opening the web app are off. + +![An incident recording played back offline](/img/screenshots/constellation-playback.png) + +## 16. Export the map + +Press `e` on the map. The map as it stands is saved as an SVG in the current directory, named for the organization and the minute, such as `constellation-acme-20261126-0905.svg`. + +The SVG keeps the theme, the palette, and the selection, and draws in vectors, so it stays sharp on a slide or in an incident write-up. The constellation theme also draws the blast radius, alarm pulses, and traffic. Metro and radar draw the blast radius in their links, and plain exports its list. + +## 17. Use it in a script + +When the output is not a terminal, `mass dashboard` prints the environments, firing alarms, and runtimes in view as tables: + +```bash +mass dashboard --env billing-dev | less +``` + +## 18. Make the keys yours + +Put the keys you want in `~/.config/massdriver/dashboard.yaml`: + +```yaml +keys: + follow_logs: [f, L] + approve: y + deploy: [] +``` + +`f` and `L` both follow logs, `y` approves, and `d` no longer deploys. The key line, the `?` legend, every box's footer, and the tutorial show the keys you chose. To keep the file somewhere else, pass it with `--keys`: + +```bash +mass dashboard --keys ~/dotfiles/dashboard-keys.yaml +``` + +[Key bindings](/guides/dashboard/reference#key-bindings) lists every action. diff --git a/docs/guides/dashboard/03-reading-the-map.md b/docs/guides/dashboard/03-reading-the-map.md new file mode 100644 index 00000000..bbcec74e --- /dev/null +++ b/docs/guides/dashboard/03-reading-the-map.md @@ -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. diff --git a/docs/guides/dashboard/04-stash-and-annotations.md b/docs/guides/dashboard/04-stash-and-annotations.md new file mode 100644 index 00000000..22946b9f --- /dev/null +++ b/docs/guides/dashboard/04-stash-and-annotations.md @@ -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. diff --git a/docs/guides/dashboard/05-reference.md b/docs/guides/dashboard/05-reference.md new file mode 100644 index 00000000..da2b0f00 --- /dev/null +++ b/docs/guides/dashboard/05-reference.md @@ -0,0 +1,310 @@ +--- +id: guides-dashboard-reference +slug: /guides/dashboard/reference +title: Massdriver Constellation Reference +sidebar_label: Reference +--- + +# Massdriver Constellation Reference + +:::caution Alpha +This feature is alpha. Names, fields, and behavior can change or be removed at any time without notice. +::: + +## Command + +```bash +mass dashboard [flags] +``` + +## Flags + +| Flag | Default | What it does | +|---|---|---| +| `--env` | The environment of the most recent deployment | The environment to center on, by id | +| `--depth` | `1` | How many hops from the focus to read | +| `--refresh` | `30s` | How often to read the status, deployments, and alarms of the instances in view again, unless every environment in view streams. `0` reads them again only when the audit log shows a change. | +| `--events` | `5s` | How often to read new audit log events. `0` turns the ticker off. | +| `--stash` | `3s` | How often to read the stash when it cannot be streamed: with a service account, while a stream reconnects, or with more than 20 environments in view. `0` reads it with each refresh. | +| `--watch` | Off | Jump to any alarm that starts firing in view, and send a desktop notification | +| `--theme` | `constellation` | How the map is drawn: `constellation`, `metro`, `radar`, or `plain` | +| `--palette` | `night` | Colors and backdrop: `night`, `rain`, or `blueprint` | +| `--flashes` | `emoji` | What rises over an environment where something happens: `emoji`, `words`, or `off`. See [Flashes](/guides/dashboard/reading-the-map#flashes). | +| `--render` | `braille` | How the map's dots are drawn: `braille` dots, or solid `blocks` for terminals that draw block characters themselves, such as Ghostty | +| `--read-only` | Off | Turn off approving, rejecting, and deploying | +| `--playback` | None | Replay an incident recording written with `w`, offline. Takes the path to the `.json` file. | +| `--tutorial` | Off | Walk through what the map shows, offline, on a made-up organization. Needs no profile. | +| `--keys` | `~/.config/massdriver/dashboard.yaml` | A key bindings file. See [Key bindings](#key-bindings). | +| `--profile` | The active profile | The configuration profile to sign in with | + +With `--playback`, only `--theme`, `--palette`, and `--render` apply. A playback reads nothing from Massdriver and is always read-only. + +With `--tutorial`, `--palette`, `--render`, and `--flashes` apply. `--theme`, `--watch`, `--read-only`, `--env`, `--depth`, and `--playback` cannot be combined with it, and the command stops with an error if you pass one. + +## Keys + +The key line at the bottom shows only the keys that do something where you are. `?` lists every key. + +### Everywhere + +| Key | What it does | +|---|---| +| `1` to `5` | Switch tabs: Constellation, Runtimes, Alarms, Upgrades, Deployments | +| `โ†` `โ†‘` `โ†“` `โ†’`, or `h` `j` `k` `l` | Move the selection | +| `tab`, `shift+tab` | Step through the list | +| `o` | Open the selection in the Massdriver web app: the environment on the map, the runtime on Runtimes, and the instance on Alarms, Upgrades, and Deployments | +| `w` | Open the write-up of an incident: the one behind the selected alarm or environment, or else the most recent | +| `r` | Read the organization again now | +| `?` | Show or hide the help for the tab, with every key | +| `esc` | Clear the search, close the help, unpick the picked instance, or put away an incident banner. With logs open, it closes only the logs. | +| `q`, `ctrl+c` | Quit | + +### Constellation + +| Key | What it does | +|---|---| +| `enter` | Move the focus to the selection now | +| `/` | Find an environment, in view or anywhere in the organization | +| `f` | Follow the selected environment's deployment logs: the one running, or else the most recent. `f` again closes them. | +| `n`, `N` | Pick the next or previous instance in the side panel | +| `y` | Approve the picked instance's deployment awaiting approval | +| `d` | Deploy the picked instance again with its current configuration | +| `t` | Replay the audit log | +| `e` | Save the map as an SVG in the current directory | +| `b` `a` `c` `g` `s` | Toggles. Each shows all five on the key line for a few seconds. See [Reading the map](/guides/dashboard/reading-the-map#toggles). | +| `v` | The next theme | +| `p` | The next palette | + +### Logs + +While you follow a deployment's logs with `f`, on the map or the Deployments tab: + +| Key | What it does | +|---|---| +| `pgup`, `ctrl+u` | Back a page | +| `pgdown`, `ctrl+d` | Forward a page | +| `shift+โ†‘`, `shift+โ†“` | Back or forward a line | +| `home` | Show the logs from the first line | +| `end`, `G` | Go to the newest line and follow it again | +| `f`, `esc` | Close the logs, and nothing else | + +While you are scrolled back, the heading shows `โ†‘ N lines back ยท end follows`. + +### Write-up + +Opened by `w`. While reading: + +| Key | What it does | +|---|---| +| `โ†‘` `โ†“`, `j` `k`, `pgup`, `pgdown` | Scroll | +| `g`, `home` | Go to the top | +| `G`, `end` | Go to the bottom | +| `e` | Edit the markdown | +| `ctrl+s` | Save the `.md` and `.json` files, replacing any saved before | +| `q`, `esc` | Close. With unsaved changes, asks first. | + +While editing: + +| Key | What it does | +|---|---| +| Any text | Edit the markdown | +| `ctrl+s` | Save | +| `esc` | Go back to reading the rendered write-up | + +When closing with unsaved changes, the heading asks `discard changes? y/n`. `y` discards them, and any other key keeps them. `โ— unsaved` shows in the heading while changes are not saved. Opening the same incident again before you quit shows the text last saved. + +### Tutorial + +With `--tutorial`: + +| Key | What it does | +|---|---| +| `โ†’`, `space`, `enter` | Next step. After the last step, explore the made-up organization with every other key. | +| `โ†` | Previous step | +| `q`, `esc` | Quit | + +### Search + +| Key | What it does | +|---|---| +| Any text | Select the first environment in view that matches | +| `backspace` | Delete a character | +| `enter` | Move the focus to the match, or search the whole organization when nothing in view matches | +| `esc` | Cancel the search and go back to the earlier selection | + +### Replay + +| Key | What it does | +|---|---| +| `โ†` `โ†’` | Choose how far back, from 5 minutes to 24 hours | +| `enter`, `space` | Start the replay | +| `esc` | Cancel before it starts | +| `space` | Pause or resume. At the end, start over. | +| `[` `]` | Slower or faster, from 1 to 16 events a step | +| `t` | Stop | + +A replay reads up to the newest 1,000 events in its window. When the window holds more, the ticker says **newest 1000 only**. + +`space`, `[`, and `]` also control a `--playback` replay. + +### Runtimes + +| Key | What it does | +|---|---| +| `โ†‘` `โ†“` | Choose a runtime | +| `p` `m` `M` | Show what a patch, minor, or major release would leave behind | +| `0` | Show the runtime as it is | +| `o` | Open the runtime in the web app | + +### Alarms and Upgrades + +| Key | What it does | +|---|---| +| `โ†‘` `โ†“` | Choose a row | +| `enter` | Show it on the map, with its blast radius | +| `o` | Open its instance in the web app | +| `w` | Open the write-up of the selected alarm's incident (Alarms only) | + +### Deployments + +| Key | What it does | +|---|---| +| `โ†‘` `โ†“` | Choose a deployment | +| `enter` | Show its environment on the map, with its blast radius | +| `o` | Open its instance in the web app | +| `f` | Follow its logs across the whole screen. `f` or `esc` closes them. | +| `c` | Show its configuration: the message, the bundle version, and the params it changes since the instance's last completed provision, with secrets masked | +| `y` | Approve a deployment awaiting approval | +| `x` | Reject a deployment awaiting approval, with an optional reason | + +### Confirmation box + +Opened by `y` and `d` on the map and `y` on the Deployments tab. It names the instance, its environment, and how many environments and instances depend on it downstream. + +| Key | What it does | +|---|---| +| `y`, `enter` | Go ahead | +| `c` | Show the configuration of the deployment awaiting approval (approve only). `esc` comes back to the box. | +| Any other key | Cancel | + +### Rejection box + +Opened by `x` on the Deployments tab. + +| Key | What it does | +|---|---| +| Any text | Type a reason, up to 200 characters. It is kept in the deployment's stash under `review/rejection`. | +| `backspace` | Delete a character | +| `enter` | Reject | +| `esc` | Cancel | + +### Configuration box + +Opened by `c` on the Deployments tab or in the confirmation box. + +| Key | What it does | +|---|---| +| `โ†‘` `โ†“`, or `j` `k` | Scroll a line | +| `space`, `pgdown`, `f` | Scroll down a page | +| `pgup`, `b` | Scroll up a page | +| `g`, `home` | Go to the top | +| `G`, `end` | Go to the bottom | +| `esc`, `c`, `q` | Close | + +## Key bindings + +The keys above are the defaults. To change them, list actions and their keys under `keys` in `~/.config/massdriver/dashboard.yaml` (`$XDG_CONFIG_HOME/massdriver/dashboard.yaml` when `XDG_CONFIG_HOME` is set), or in the file you name with `--keys`: + +```yaml +keys: + approve: [y] + follow_logs: [f, L] + quit: [q, ctrl+c] +``` + +An action's keys replace its defaults everywhere it works, so rebinding one of these changes more than one place: `quit`, `left`, `right`, `select`, `follow_logs`, `approve`, `config`, `cancel`, `submit`, `scroll_up`, `scroll_down`, `page_up`, `page_down`, `top`, `bottom`, `close`, `save`, and `force_quit`. A single key needs no list, and an empty list turns the action off. `ctrl+c` always quits, or cancels a rejection, whatever the file says, and cannot be bound to anything else. Keys are named as `space`, `enter`, `esc`, `tab`, `shift+tab`, `backspace`, `up`, `down`, `left`, `right`, `shift+up`, `pgup`, `pgdown`, `home`, `end`, `f1` through `f20`, `ctrl+` or `alt+` and a key, or a single character; quote punctuation YAML reads as its own, such as `"?"`, `"["`, and `"]"`. `mass dashboard` will not start if the file names an action or key it does not know, if it is not valid YAML, or if one key would do two things in the same place. The search box, the rejection reason, and the write-up editor take any character you type, so their actions cannot be bound to one; a named key or an `alt+` key works there. + +| Action | Where | Default keys | +|---|---|---| +| `quit` | any tab; replay picker; tutorial | `q` `ctrl+c`; `ctrl+c` `q`; `q` `esc` `ctrl+c` | +| `constellation`, `runtimes`, `alarms`, `upgrades`, `deployments` | any tab | `1`, `2`, `3`, `4`, `5` | +| `up`, `down` | any tab | `up` `k`, `down` `j` | +| `left`, `right` | any tab; replay picker | `left` `h`, `right` `l` | +| `next`, `prev` | any tab | `tab`, `shift+tab` | +| `select` | any tab; replay picker | `enter`; `enter` `space` | +| `reload` | any tab | `r` | +| `open` | any tab | `o` | +| `write_up` | any tab | `w` | +| `help` | any tab | `?` | +| `dismiss` | any tab | `esc` | +| `find` | map | `/` | +| `follow_logs` | map; Deployments | `f` | +| `pick_next`, `pick_prev` | map | `n`, `N` | +| `approve` | map; Deployments | `y` | +| `deploy` | map | `d` | +| `replay` | map | `t` | +| `theme` | map | `v` | +| `palette` | map | `p` | +| `export` | map | `e` | +| `toggle_blast`, `toggle_apps`, `toggle_cost`, `toggle_projects`, `toggle_stack` | map | `b`, `a`, `c`, `g`, `s` | +| `pause`, `slower`, `faster` | replay | `space`, `[`, `]` | +| `bump_none`, `bump_patch`, `bump_minor`, `bump_major` | Runtimes | `0`, `p`, `m`, `M` | +| `config` | Deployments; approval | `c` | +| `reject` | Deployments | `x` | +| `logs_page_up`, `logs_page_down` | logs | `pgup` `ctrl+u`, `pgdown` `ctrl+d` | +| `logs_up`, `logs_down` | logs | `shift+up`, `shift+down` | +| `logs_top`, `logs_bottom` | logs | `home`, `end` `G` | +| `confirm` | approval and deploy | `y` `enter` | +| `submit` | rejection reason; search | `enter` | +| `cancel` | replay picker; rejection reason; search | `esc` `t`; `esc` `ctrl+c`; `esc` | +| `scroll_up`, `scroll_down` | configuration; write-up | `up` `k`, `down` `j` | +| `page_up`, `page_down` | configuration; write-up | `pgup` `b`, `pgdown` `space` `f` | +| `half_page_up`, `half_page_down` | write-up | `u` `ctrl+u`, `d` `ctrl+d` | +| `top`, `bottom` | configuration; write-up | `home` `g`, `end` `G` | +| `close` | configuration; write-up | `esc` `c` `q`; `q` `esc` | +| `edit` | write-up | `e` | +| `save` | write-up and its editor | `ctrl+s` | +| `preview` | write-up editor | `esc` | +| `discard` | unsaved write-up | `y` | +| `force_quit` | configuration; write-up and its editor | `ctrl+c` | +| `forward`, `backward` | tutorial | `right` `space` `enter`, `left` | + +## Files + +| Key | File | Name | +|---|---|---| +| `ctrl+s` in a write-up | Incident write-up, in markdown | `incident---.md` | +| `ctrl+s` in a write-up | Incident recording, for `--playback` | `incident---.json` | +| `e` on the map | The map, as an SVG | `constellation--.svg` | + +Every file goes in the current directory. Incident files are named for the minute the incident started, in UTC, only you can read them, and saving again replaces them. The SVG is named for the minute you saved it. + +## Output to a file or a pipe + +When the output is not a terminal, `mass dashboard` prints three tables instead of drawing the screen: the environments in view, the firing alarms with how much is downstream of each, and the runtimes with how many of their instances run the latest version. `--env` and `--depth` choose what is in view. + +## Large organizations + +Massdriver Constellation reads the whole map when it starts, when you refocus or search, when you press `r`, after you approve or deploy, and when the audit log shows an instance or a connection added, removed, or moved in view, or a remote reference or an environment default set. Between those, `--refresh` reads only the status, deployments, and alarms of the instances already in view, and skips even that while every environment in view streams and the audit log is followed. A deployment or an alarm in the audit log reads the status at once. + +Massdriver Constellation reads one neighborhood at a time, so the size of your organization does not change how much it reads. What it reads grows with `--depth` and with how many environments share resources with the focus. Search reads the list of environment ids and names once, the first time a search finds nothing in view. With more than 20 environments in view, the stash is read every `--stash` interval rather than streamed. + +## Troubleshooting + +| What you see | Why | +|---|---| +| Notes and pinned widgets are missing | The profile signs in as a service account. Use a profile with your personal access token. | +| Stash changes and logs arrive a few seconds late | The profile signs in as a service account, so the stash is read every `--stash` interval and logs every 2 seconds. Use a profile with your personal access token to stream them. | +| An environment shows a ๐Ÿ”ญ | It is past `--depth`. Select it, or raise `--depth`. | +| A new fork does not show | Forks are not read until the map is. Press `r`, or refocus. | +| `mass dashboard` will not start and names an action or a key | The key bindings file has an action or key it does not know, is not valid YAML, or binds one key to two things in the same place. | +| An environment shows as **no access** | You cannot view its project. | +| A link says `stale` | Its traffic has not been reported for 10 minutes. | +| A stash key changes but nothing shows on the ticker or the map | No widget draws that key. Only well-known `md/v1/` keys and keys a widget you pinned reads are shown. | +| No widgets show | Nothing in view has a well-known `md/` key. See [Well-known keys](/guides/stash/well-known-keys). | +| `y`, `x`, or `d` says it is read-only | It was started with `--read-only` or `--playback`. Start it again without them. | +| `y` says to pick an instance first | Press `n` to pick an instance in the side panel. | +| Approving or rejecting says only a proposed deployment can be | The deployment is no longer awaiting approval. | +| A rejection says the reason was not saved | The deployment was rejected, but its stash could not be written. | +| Links in the side panel are not clickable | The terminal does not support hyperlinks. iTerm2, Ghostty, WezTerm, and kitty do. | +| No desktop notification with `--watch` | The terminal does not support OSC 9 notifications. The bell still rings. | diff --git a/docs/guides/dashboard/_category_.yml b/docs/guides/dashboard/_category_.yml new file mode 100644 index 00000000..023be873 --- /dev/null +++ b/docs/guides/dashboard/_category_.yml @@ -0,0 +1,6 @@ +label: Massdriver Constellation +collapsible: true +collapsed: true +link: + type: doc + id: guides-dashboard-overview diff --git a/static/img/screenshots/constellation-constellation.png b/static/img/screenshots/constellation-constellation.png new file mode 100644 index 00000000..39354e53 Binary files /dev/null and b/static/img/screenshots/constellation-constellation.png differ diff --git a/static/img/screenshots/constellation-deployment-config.png b/static/img/screenshots/constellation-deployment-config.png new file mode 100644 index 00000000..ce0e4730 Binary files /dev/null and b/static/img/screenshots/constellation-deployment-config.png differ diff --git a/static/img/screenshots/constellation-deployments.png b/static/img/screenshots/constellation-deployments.png new file mode 100644 index 00000000..3dc81370 Binary files /dev/null and b/static/img/screenshots/constellation-deployments.png differ diff --git a/static/img/screenshots/constellation-legend.png b/static/img/screenshots/constellation-legend.png new file mode 100644 index 00000000..4ba624f3 Binary files /dev/null and b/static/img/screenshots/constellation-legend.png differ diff --git a/static/img/screenshots/constellation-logs.png b/static/img/screenshots/constellation-logs.png new file mode 100644 index 00000000..c6ceb799 Binary files /dev/null and b/static/img/screenshots/constellation-logs.png differ diff --git a/static/img/screenshots/constellation-palette-2.png b/static/img/screenshots/constellation-palette-2.png new file mode 100644 index 00000000..3491cf3d Binary files /dev/null and b/static/img/screenshots/constellation-palette-2.png differ diff --git a/static/img/screenshots/constellation-palette-3.png b/static/img/screenshots/constellation-palette-3.png new file mode 100644 index 00000000..d19fb3c3 Binary files /dev/null and b/static/img/screenshots/constellation-palette-3.png differ diff --git a/static/img/screenshots/constellation-playback.png b/static/img/screenshots/constellation-playback.png new file mode 100644 index 00000000..f8184791 Binary files /dev/null and b/static/img/screenshots/constellation-playback.png differ diff --git a/static/img/screenshots/constellation-replay-picker.png b/static/img/screenshots/constellation-replay-picker.png new file mode 100644 index 00000000..b350fbd2 Binary files /dev/null and b/static/img/screenshots/constellation-replay-picker.png differ diff --git a/static/img/screenshots/constellation-replay.png b/static/img/screenshots/constellation-replay.png new file mode 100644 index 00000000..3ec1dda6 Binary files /dev/null and b/static/img/screenshots/constellation-replay.png differ diff --git a/static/img/screenshots/constellation-runtimes.png b/static/img/screenshots/constellation-runtimes.png new file mode 100644 index 00000000..0fdd6b8c Binary files /dev/null and b/static/img/screenshots/constellation-runtimes.png differ diff --git a/static/img/screenshots/constellation-search.png b/static/img/screenshots/constellation-search.png new file mode 100644 index 00000000..6bdafa35 Binary files /dev/null and b/static/img/screenshots/constellation-search.png differ diff --git a/static/img/screenshots/constellation-theme-metro.png b/static/img/screenshots/constellation-theme-metro.png new file mode 100644 index 00000000..406fec3a Binary files /dev/null and b/static/img/screenshots/constellation-theme-metro.png differ diff --git a/static/img/screenshots/constellation-theme-plain.png b/static/img/screenshots/constellation-theme-plain.png new file mode 100644 index 00000000..4969496e Binary files /dev/null and b/static/img/screenshots/constellation-theme-plain.png differ diff --git a/static/img/screenshots/constellation-theme-radar.png b/static/img/screenshots/constellation-theme-radar.png new file mode 100644 index 00000000..db1430f5 Binary files /dev/null and b/static/img/screenshots/constellation-theme-radar.png differ diff --git a/static/img/screenshots/constellation-tutorial-1.png b/static/img/screenshots/constellation-tutorial-1.png new file mode 100644 index 00000000..7fb0e24a Binary files /dev/null and b/static/img/screenshots/constellation-tutorial-1.png differ diff --git a/static/img/screenshots/constellation-upgrades.png b/static/img/screenshots/constellation-upgrades.png new file mode 100644 index 00000000..786ec61c Binary files /dev/null and b/static/img/screenshots/constellation-upgrades.png differ diff --git a/static/img/screenshots/constellation-writeup-edit.png b/static/img/screenshots/constellation-writeup-edit.png new file mode 100644 index 00000000..739435f3 Binary files /dev/null and b/static/img/screenshots/constellation-writeup-edit.png differ diff --git a/static/img/screenshots/constellation-writeup.png b/static/img/screenshots/constellation-writeup.png new file mode 100644 index 00000000..60fe70ba Binary files /dev/null and b/static/img/screenshots/constellation-writeup.png differ