Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/continuous-delivery/automations/19-statuspage.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ An incident opens when a row becomes degraded or worse, and resolves when the ro

| Key | Scope | On the page |
|---|---|---|
| `md/v1/health` | instance | `healthy`, `ok`, and `up` add nothing. `degraded`, `warning`, and `recovering` show degraded performance. `down`, `failed`, and `error` show the impact of the instance, or major outage. |
| `md/v1/health` | instance | A `red` color shows the impact of the instance, or major outage. `amber` shows degraded performance. Any other color adds nothing. Without a color, the `state` sets the status: `healthy`, `ok`, and `up` add nothing. `degraded`, `warning`, and `recovering` show degraded performance. `down`, `failed`, and `error` show the impact of the instance, or major outage. |
| `md/v1/banner` | environment | A notice with the environment title, on every page that has the environment. `info` and `warning` show as those levels, and `error` as critical. A banner changes no status. |

The stash adds to the alarms. A row takes the worse of the two, so a firing alarm still shows when the health is `healthy`. A missing, expired, or unknown health changes nothing: it is not healthy and not down. Uptime counts a stash outage as it counts an alarm.
Expand Down
33 changes: 23 additions & 10 deletions docs/guides/annotations/03-widgets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ To hide automatic widgets, click the **Widgets** button in the canvas toolbar, a

| Key | Set on | Format | Widget | Add by hand |
|---|---|---|---|---|
| `md/v1/health` | Instance | TEXT | [Status dot](#status-dot) | yes |
| `md/v1/health` | Instance | JSON | [Status dot](#status-dot) | yes |
| `md/v1/usage` | Instance | JSON | [Usage bar](#usage-bar) | yes |
| `md/v1/traffic` | Instance | JSON | [Traffic](#traffic) on the lines that leave the instance | yes |
| `md/v1/banner` | Environment | JSON | [Banner](#banner) | yes |
Expand All @@ -58,22 +58,34 @@ A colored dot in the header of an instance node. The tooltip shows the label and

### Automatic: `md/v1/health`

Set on the instance. Format: TEXT.
Set on the instance. Format: JSON.

The value must match the [`md/v1/health` schema](/guides/stash/well-known-keys#mdv1health).
The value must match the [`md/v1/health` schema](/guides/stash/well-known-keys#mdv1health). `state` is the word shown with the dot. `color` is optional.

```bash
mass alpha stash set billing-dev-app.md/v1/health degraded
mass alpha stash set billing-dev-app.md/v1/health '{"state": "Rolling out", "color": "blue"}' --format json
```

### What it looks like

| State | Looks like | Value | Meaning |
|---|---|---|---|
| Healthy | <StatusDotState tone="success" label="Status dot healthy: a green dot" /> | `healthy`, `ok`, or `up` | A green dot. |
| Degraded | <StatusDotState tone="warning" label="Status dot degraded: an amber dot" /> | `degraded`, `warning`, or `recovering` | An amber dot. |
| Down | <StatusDotState tone="error" label="Status dot down: a red dot" /> | `down`, `failed`, or `error` | A red dot. |
| Unknown | <StatusDotState tone="neutral" label="Status dot with an unknown value: a gray dot" /> | any other text | A gray dot. |
| Color | Looks like |
|---|---|
| `green` | <StatusDotState tone="success" label="Status dot: a green dot" /> |
| `amber` | <StatusDotState tone="warning" label="Status dot: an amber dot" /> |
| `red` | <StatusDotState tone="error" label="Status dot: a red dot" /> |
| `blue` | <StatusDotState tone="info" label="Status dot: a blue dot" /> |
| `purple` | <StatusDotState tone="pending" label="Status dot: a purple dot" /> |
| `gray` | <StatusDotState tone="neutral" label="Status dot: a gray dot" /> |
| A hex color, such as `#7C3AED` | <StatusDotState color="#7C3AED" label="Status dot: a dot in the hex color #7C3AED" /> |

Without a color, the state sets the color:

| State | Color |
|---|---|
| `healthy`, `ok`, or `up` | Green |
| `degraded`, `warning`, or `recovering` | Amber |
| `down`, `failed`, or `error` | Red |
| any other state | Gray |

The match ignores case and spaces at each end.

Expand All @@ -84,6 +96,7 @@ Right-click an instance node and choose **Add widget** > **Status dot**.
| Input | Type | Required | Example key | Path |
|---|---|---|---|---|
| `state` | string | yes | `status/health` on the instance (TEXT) | none |
| `color` | string | no | `status/color` on the instance (TEXT) | none |

## Usage bar

Expand Down
2 changes: 1 addition & 1 deletion docs/guides/annotations/04-metadata.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ The instance Signals tab shows the instance's automatic widgets above the entrie

| Stat | Key | Value |
|---|---|---|
| Health | `md/v1/health` | A colored dot and the value |
| Health | `md/v1/health` | A colored dot and the state |
| Traffic | `md/v1/traffic` | A colored dot and the traffic label for the lines that leave the instance, such as `240 rps · 180 ms`. It says "stale" when the data is more than 10 minutes old. |
| Usage | `md/v1/usage` | The usage bar and the numbers, such as `37 / 100` |

Expand Down
4 changes: 2 additions & 2 deletions docs/guides/dashboard/02-tour.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ Massdriver Constellation streams the stash, so each key shows the moment it is s
Open a second terminal and set a few [well-known keys](/guides/stash/well-known-keys):

```bash
mass alpha stash set billing-dev-app.md/v1/health degraded
mass alpha stash set billing-dev-app.md/v1/health '{"state": "degraded"}' --format json
```

`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.
Expand Down Expand Up @@ -158,7 +158,7 @@ The bar is amber from 80% and red from 95%. A 📊 rises, and the ticker draws a
Set the health back when you are done:

```bash
mass alpha stash set billing-dev-app.md/v1/health healthy
mass alpha stash set billing-dev-app.md/v1/health '{"state": "healthy"}' --format json
```

See [Stash and annotations](/guides/dashboard/stash-and-annotations) for every widget, and for the notes and widgets you pin yourself.
Expand Down
6 changes: 3 additions & 3 deletions docs/guides/dashboard/04-stash-and-annotations.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ 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/health` | 🩺 | A dot in the health's color and the state, 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 |
Expand All @@ -62,7 +62,7 @@ A [well-known key](/guides/stash/well-known-keys) draws its widget for everyone

| 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/health` | Instance | The instance's dot, and its state in the side panel. The dot has the `color` of the value: `green`, `amber`, `red`, `blue`, `purple`, `gray`, or a hex color such as `#7C3AED`. Without a color, the state sets the color: 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 |
Expand All @@ -71,7 +71,7 @@ A [well-known key](/guides/stash/well-known-keys) draws its widget for everyone
For example:

```bash
mass alpha stash set billing-dev-app.md/v1/health degraded
mass alpha stash set billing-dev-app.md/v1/health '{"state": "Rolling out", "color": "blue"}' --format json
mass alpha stash set billing-dev-app.md/v1/usage '{"value": 37, "max": 100, "label": "connections"}' --format json
mass alpha stash set billing-dev-app.md/v1/traffic '{"rps": 240, "errors_5m": 2, "p95_ms": 85}' --format json
mass alpha stash set billing-dev.md/v1/banner '{"message": "Deploy freeze until Friday", "level": "warning"}' --format json
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/stash/01-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This feature is alpha. Names, fields, and behavior can change or be removed at a

The stash keeps small values about your infrastructure next to the project, environment, component, instance, or deployment they describe. People, the Massdriver UI, the CLI, automations, and later deployment steps can all read them.

Each project, environment, component, instance, and deployment has its own stash. A stash holds key and value entries, such as `db/hostname` = `billing-dev.cluster-abc.us-east-1.rds.amazonaws.com` or `md/v1/health` = `healthy`. Massdriver keeps an entry until you delete it or until it expires.
Each project, environment, component, instance, and deployment has its own stash. A stash holds key and value entries, such as `db/hostname` = `billing-dev.cluster-abc.us-east-1.rds.amazonaws.com` or `md/v1/health` = `{"state": "healthy"}`. Massdriver keeps an entry until you delete it or until it expires.

## Who writes to the stash

Expand Down Expand Up @@ -64,7 +64,7 @@ mass alpha stash set "$MASSDRIVER_DEPLOYMENT_ID.md/v1/cost_estimate" \
Write `md/v1/health`, `md/v1/usage`, or `md/v1/traffic` on an instance. A status dot, a usage bar, or traffic on its lines shows on the canvas for everyone with `stash:view`. Set a TTL so that the widget goes away when the writer stops.

```bash
mass alpha stash set billing-dev-app.md/v1/health degraded --ttl 600
mass alpha stash set billing-dev-app.md/v1/health '{"state": "degraded"}' --format json --ttl 600
mass alpha stash set billing-dev-app.md/v1/traffic '{"rps": 240, "errors_5m": 2, "p95_ms": 180}' --format json --ttl 600
```

Expand Down
29 changes: 21 additions & 8 deletions docs/guides/stash/02-well-known-keys.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ These are the widget keys:

| Key | Set on | Format | Widget name | Widget |
|---|---|---|---|---|
| `md/v1/health` | Instance | TEXT | `instance.status_dot` | Status dot on the instance |
| `md/v1/health` | Instance | JSON | `instance.status_dot` | Status dot on the instance |
| `md/v1/usage` | Instance | JSON | `instance.usage_bar` | Usage bar on the instance |
| `md/v1/traffic` | Instance | JSON | `link.traffic` | Traffic on the lines that leave the instance |
| `md/v1/urls` | Instance | JSON | `instance.urls` | Docs, API, and App buttons in the instance panel |
Expand Down Expand Up @@ -75,23 +75,36 @@ The `alphaWidgetCatalog` query returns these keys, their versions, and their sch

## `md/v1/health`

Set on an instance. Format: TEXT. Shows the [status dot](/guides/annotations/widgets#status-dot).
Set on an instance. Format: JSON. Shows the [status dot](/guides/annotations/widgets#status-dot).

```json
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.massdriver.cloud/stash/md/v1/health.json",
"type": "string",
"minLength": 1,
"maxLength": 64,
"examples": ["healthy", "degraded", "down"]
"type": "object",
"required": ["state"],
"additionalProperties": false,
"properties": {
"state": { "type": "string", "minLength": 1, "maxLength": 64 },
"color": {
"anyOf": [
{ "enum": ["green", "amber", "red", "blue", "purple", "gray"] },
{ "type": "string", "pattern": "^#[0-9a-fA-F]{6}(?![\\s\\S])" }
]
}
}
}
```

The dot is green for `healthy`, `ok`, and `up`. It is amber for `degraded`, `warning`, and `recovering`. It is red for `down`, `failed`, and `error`. It is gray for any other value.
| Field | Meaning |
|---|---|
| `state` | The word shown with the dot, for example `Rolling out`. |
| `color` | Optional. The color of the dot: `green`, `amber`, `red`, `blue`, `purple`, `gray`, or a hex color with six digits, such as `#7C3AED`. |

Without `color`, the state sets the color. The dot is green for `healthy`, `ok`, and `up`. It is amber for `degraded`, `warning`, and `recovering`. It is red for `down`, `failed`, and `error`. It is gray for any other state.

```bash
mass alpha stash set billing-dev-app.md/v1/health degraded
mass alpha stash set billing-dev-app.md/v1/health '{"state": "Rolling out", "color": "blue"}' --format json
```

## `md/v1/usage`
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/stash/06-provisioners.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ Do not put secrets in labels. A label is not encrypted. `--sensitive` encrypts a

## Widgets

The `md/v1/health`, `md/v1/usage`, and `md/v1/traffic` keys on the instance, and the `md/v1/banner` and `md/v1/links` keys on the environment, show [widgets](/guides/annotations/widgets) on the canvas. Health, usage, and traffic show live data. A provisioner can set a first value, for example `md/v1/health` = `healthy` after a successful apply. A metrics job, such as the [`stash-sync` automation](/guides/stash/recipes#sync-metrics-with-stash-sync), keeps the values current.
The `md/v1/health`, `md/v1/usage`, and `md/v1/traffic` keys on the instance, and the `md/v1/banner` and `md/v1/links` keys on the environment, show [widgets](/guides/annotations/widgets) on the canvas. Health, usage, and traffic show live data. A provisioner can set a first value, for example `md/v1/health` with the state `healthy` after a successful apply. A metrics job, such as the [`stash-sync` automation](/guides/stash/recipes#sync-metrics-with-stash-sync), keeps the values current.

```bash
mass alpha stash set "$MASSDRIVER_INSTANCE_ID.md/v1/health" healthy
mass alpha stash set "$MASSDRIVER_INSTANCE_ID.md/v1/health" '{"state": "healthy"}' --format json
```

## Deployment results
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,14 +270,14 @@ The attributes of the entity that holds the entry. For a deployment's entry, the
"id": "9e4c2a7b-1d3f-4b6e-8a0c-5f2d7b9e1c34",
"key": "md/v1/health",
"label": "Health",
"format": "text",
"format": "json",
"immutable": false,
"sensitive": false,
"expires_at": "2026-11-24T06:54:03Z",
"updated_at": "2026-11-24T06:44:03Z",
"scope": { "kind": "instance", "id": "api-prod-database" },
"value": "degraded",
"data": null
"value": "{\"state\": \"degraded\"}",
"data": { "state": "degraded" }
},
"actor": {
"service_account_id": "c3e9a7b2-5d1f-4a8e-b6c0-9f2d4e7a1b85",
Expand All @@ -302,6 +302,6 @@ The attributes of the entity that holds the entry. For a deployment's entry, the

| To send | Events | Condition |
|---|---|---|
| Health changes to `down` | `stash_entry.set` | `.data.entity.key == "md/v1/health" and .data.entity.value == "down"` |
| Health changes to `down` | `stash_entry.set` | `.data.entity.key == "md/v1/health" and .data.entity.data.state == "down"` |
| Banners in production | `stash_entry.set` | `.data.entity.key == "md/v1/banner" and .data.attributes["md-environment"] == "prod"` |
| Entries deleted by a person | `stash_entry.deleted` | `.data.actor.account_id != null` |
2 changes: 1 addition & 1 deletion docs/reference/cli/commands/mass_alpha_stash.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ mass alpha stash set "$MASSDRIVER_DEPLOYMENT_ID.md/v1/changes/$MASSDRIVER_STEP_P
Show an instance's health on the canvas for ten minutes:

```bash
mass alpha stash set billing-dev-app.md/v1/health degraded --ttl 600
mass alpha stash set billing-dev-app.md/v1/health '{"state": "degraded"}' --format json --ttl 600
```

Show a maintenance banner on an environment for two hours:
Expand Down
4 changes: 2 additions & 2 deletions src/components/Annotations/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ export function TrafficState({ state, label }) {
);
}

export function StatusDotState({ tone, label }) {
export function StatusDotState({ tone, color, label }) {
return (
<Figure label={label} width={150} height={44}>
<rect className={s.node} x={2} y={4} width={146} height={36} rx={6} />
<circle cx={16} cy={22} r={5} style={{ fill: TONE_VAR[tone] }} />
<circle cx={16} cy={22} r={5} style={{ fill: color ?? TONE_VAR[tone] }} />
<text className={s.strong} x={28} y={26}>
billing-dev-app
</text>
Expand Down