Widgets
This feature is alpha. Names, fields, and behavior can change or be removed at any time without notice.
A widget is a built-in picture that shows stash values. There are two ways to show one.
- Automatic. Write a well-known
md/v1/key. Everyone withstash:viewon the stash sees the widget. You do not set anything up. - Added by you. Right-click the canvas, choose Add widget, and choose a stash entry for each input. Only you see it. You can add a status dot, a usage bar, traffic, a banner, or header links. For a step-by-step example, see Add a widget from your own keys.
When you add a widget in the same place as an automatic one, you see your widget. If your widget has no value, you see the automatic one.
Each widget has a tooltip. It shows the widget's label and value, for example Connection pool: 37 of 100 (37%), and when the stash entry was last updated, for example Updated 2m ago. The label is the stash entry's label, which you set with --label. A usage bar without an entry label uses the label field of its value. Otherwise the widget uses a default label: Health, Traffic, or Usage.
To hide automatic widgets, click the Widgets button in the canvas toolbar, after the inactive instances button. The setting is saved in your browser and applies only to you. It hides the automatic widgets on the canvas, in the instance panel, and on the project overview. Widgets that you add still show.
Well-known keys​
| Key | Set on | Format | Widget | Add by hand |
|---|---|---|---|---|
md/v1/health | Instance | JSON | Status dot | yes |
md/v1/usage | Instance | JSON | Usage bar | yes |
md/v1/traffic | Instance | JSON | Traffic on the lines that leave the instance | yes |
md/v1/banner | Environment | JSON | Banner | yes |
md/v1/links | Environment | JSON | Header links | yes |
md/v1/urls | Instance | JSON | Instance links | no |
md/v1/oncall | Environment | JSON | On call | no |
md/v1/leaderboard | Environment | JSON | Leaderboard | no |
md/v1/scorecard/<scorecard> | Instance, environment, or project | JSON | Scorecards | no |
md/v1/delivery, md/v1/reliability, md/v1/currency, md/v1/pending | Instance | JSON | Scorecard facts | no |
md/v1/parity | Environment | JSON | Parity | no |
md/v1/ownership | Project or environment | JSON | Ownership | no |
Deployment results show in deployment details, on the instance Signals tab, and as a warning badge on the canvas. Notices show under the bell in the app header.
The md/ prefix is reserved. The server checks each write to an md/ key. See Well-known keys for the rules and the full schema of each key.
Status dot​
A colored dot in the header of an instance node. The tooltip shows the label and the value, for example Health: degraded.
Automatic: md/v1/health​
Set on the instance. Format: JSON.
The value must match the md/v1/health schema. state is the word shown with the dot. color is optional.
mass alpha stash set billing-dev-app.md/v1/health '{"state": "Rolling out", "color": "blue"}' --format json
What it looks like​
| Color | Looks like |
|---|---|
green | |
amber | |
red | |
blue | |
purple | |
gray | |
A hex color, such as #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.
Use your own stash keys​
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​
A thin bar at the bottom of an instance node. The label is on the left of the bar. The value and the limit, for example 37 / 100, are on the right.
Automatic: md/v1/usage​
Set on the instance. Format: JSON.
The value must match the md/v1/usage schema.
| Field | Meaning |
|---|---|
value | The amount in use. |
max | The limit. |
label | Optional. The label on the left of the bar, when the entry has no --label. |
mass alpha stash set billing-dev-app.md/v1/usage '{"value": 37, "max": 100, "label": "connections"}' --format json
What it looks like​
| State | Looks like | Value | Meaning |
|---|---|---|---|
| Under 80% | {"value": 37, "max": 100, "label": "connections"} | A teal bar. | |
| 80% to 94% | {"value": 86, "max": 100, "label": "connections"} | An amber bar. | |
| 95% or more | {"value": 97, "max": 100, "label": "connections"} | A red bar. |
A value above max fills the bar.
Use your own stash keys​
Right-click an instance node and choose Add widget > Usage bar. Each input can read a different key. For example, two TEXT entries:
mass alpha stash set billing-dev-app.db/connections 37
mass alpha stash set billing-dev-app.db/max_connections 100
| Input | Type | Required | Example key | Path |
|---|---|---|---|---|
value | number | yes | db/connections on the instance | none |
max | number | yes | db/max_connections on the instance | none |
label | string | no | none | none |
A usage bar that you add with a max of 0 or less does not show.
Traffic​
The traffic on a line between two instances, shown as the width, color, and movement of the line. A short label on the line shows the rate, the errors, the p95 latency, and "stale" when the data is old. For example, 240 rps · 2 err · 180 ms. The label leaves out the errors when there are none, and the latency when there is no value.
Automatic: md/v1/traffic​
Set on the instance that sends the traffic. Format: JSON. Every line that leaves that instance shows the traffic.
The value must match the md/v1/traffic schema.
| Field | Meaning | Input |
|---|---|---|
rps | Requests per second. | rate |
errors_5m | Errors in the last 5 minutes. | errors |
p95_ms | Optional. p95 latency in milliseconds. | latency |
mass alpha stash set billing-dev-app.md/v1/traffic '{"rps": 240, "errors_5m": 2, "p95_ms": 180}' --format json
Write the entry on a schedule. When it is not updated for 10 minutes, the line shows as stale. Add --ttl to remove the entry, and the widget, after a time.
What it looks like​
| State | Looks like | Value | Meaning |
|---|---|---|---|
| Off | key missing or expired | The line shows as usual. | |
| Idle | {"rps": 0, "errors_5m": 0} | Rate 0. A thin gray dashed line. | |
| Flowing | {"rps": 240, "errors_5m": 0, "p95_ms": 180} | Rate above 0 and no errors. A teal line. | |
| Some errors | {"rps": 240, "errors_5m": 3, "p95_ms": 180} | 1 to 9 errors. An amber line. | |
| Many errors | {"rps": 240, "errors_5m": 42, "p95_ms": 180} | 10 or more errors. A red line. | |
| Stale | not updated for 10 minutes | The line fades to half opacity. |
The line width follows the rate:
| Rate | Width |
|---|---|
| under 10 | 3px |
| 10 to 99 | 4px |
| 100 to 999 | 6px |
| 1000 or more | 8px |
On a line with traffic, dashes move from the source instance to the destination instance. Higher rates move faster. When your system asks for reduced motion, the line is solid and does not move.
Use your own stash keys​
Right-click a line and choose Add widget > Traffic. You can read from the source or the destination instance.
| Input | Type | Required | Example key | Path |
|---|---|---|---|---|
rate | number | yes | stats/traffic on destination (JSON) | rps |
errors | integer | yes | stats/traffic on destination (JSON) | errors_5m |
latency | number | no | stats/traffic on destination (JSON) | p95_ms |
Banner​
A message across the top of the environment canvas. Banners stack.
Automatic: md/v1/banner​
Set on the environment. Format: JSON.
The value must match the md/v1/banner schema.
| Field | Meaning |
|---|---|
message | The banner text. |
level | Optional. info (blue, the default), warning (amber), or error (red). |
mass alpha stash set billing-dev.md/v1/banner '{"message": "Deploy freeze until Friday", "level": "warning"}' --format json
What it looks like​
| State | Looks like | Value | Meaning |
|---|---|---|---|
| Info | {"message": "Database upgrade tonight"} | A blue banner. | |
| Warning | {"message": "Deploy freeze until Friday", "level": "warning"} | An amber banner. | |
| Error | {"message": "Payments API is down", "level": "error"} | A red banner. | |
| Two banners | md/v1/banner and a banner that you added | Banners stack, one per widget. |
Use your own stash keys​
Right-click an empty part of the canvas and choose Add widget > Banner. For example, a short-lived TEXT entry:
mass alpha stash set billing-dev.status/maintenance "Database upgrade tonight" --ttl 86400
| Input | Type | Required | Example key | Path |
|---|---|---|---|---|
message | string | yes | status/maintenance on the environment | none |
level | string | no | none | none |
A banner that you add with a level that is not info, warning, or error shows as info.
Header links​
Link buttons in the environment header, such as a dashboard or a runbook. A button opens its URL in a new tab.
Automatic: md/v1/links​
Set on the environment. Format: JSON. Each item in links is one button.
The value must match the md/v1/links schema.
| Field | Meaning |
|---|---|
links[].label | The button text. |
links[].url | An http or https URL. |
mass alpha stash set billing-dev.md/v1/links '{"links": [{"label": "Shop", "url": "https://shop.example.com"}, {"label": "Grafana", "url": "https://grafana.example.com/d/billing"}]}' --format json
What it looks like​
| State | Looks like | Value | Meaning |
|---|---|---|---|
| One link | {"links": [{"label": "Shop", "url": "https://shop.example.com"}]} | One button. | |
| Two links | two items in links | One button per item. | |
| Not an http URL | {"links": [{"label": "Shop", "url": "https://shop.example.com"}, {"label": "Files", "url": "ftp://files.example.com"}]} | The server rejects this value for md/v1/links. In a header link widget that you add, the link with the ftp URL does not show and the other links do. |
Use your own stash keys​
Right-click an empty part of the canvas and choose Add widget > Header link. The widget has one input, links. Point it at a JSON entry that holds a list of links in the same shape as md/v1/links:
mass alpha stash set billing-dev.links '{"links": [{"label": "Shop", "url": "https://shop.example.com"}]}' --format json --label "Links"
| Input | Type | Required | Example key | Path |
|---|---|---|---|---|
links | array | yes | links on the environment (JSON) | links |
Each item is one button. The first 8 links with an http or https url show. A link without a label shows the URL host.
Instance links​
Buttons in the instance panel header, under the instance's details: Docs, API, and App. A button opens its URL in a new tab.
Automatic: md/v1/urls​
Set on the instance. Format: JSON.
The value must match the md/v1/urls schema.
| Field | Button |
|---|---|
docs_url | Docs |
api_url | API |
app_url | App |
mass alpha stash set billing-dev-app.md/v1/urls '{"docs_url": "https://docs.example.com/billing", "app_url": "https://billing.example.com"}' --format json
What it looks like​
One outlined button for each field that is set, in the order of the table. A field that is not set has no button.
On call and leaderboard​
Cards in the top-right corner of the environment canvas. On call is above Leaderboard. A card shows only when its key has at least one person.
Automatic: md/v1/oncall and md/v1/leaderboard​
Set on the environment. Format: JSON. Both keys have the same shape.
The value must match the md/v1/oncall schema or the md/v1/leaderboard schema.
| Field | Meaning |
|---|---|
title | Optional. The card's title. The default is On call or Leaderboard. |
entries | Up to 25 people, in order. Each has any of a name, an image_url, an email, and handles. |
mass alpha stash set billing-prod.md/v1/oncall '{"entries": [{"name": "Jo Park", "email": "jo@example.com", "handles": ["slack:@jo"]}, {"name": "Lee Chen", "handles": ["github:lee"]}]}' --format json
The oncall automation writes md/v1/oncall from PagerDuty or incident.io. The leaderboard automation writes md/v1/leaderboard from GitHub pull requests.
What it looks like​
| Part | Shows |
|---|---|
| Title | The title, or the default. Click it to collapse or expand the card. Your browser keeps this setting. |
| Person | A picture from image_url, or the first letter of the person's name, and the name. The name is name, or email, or the first handle. |
| Rank | On the leaderboard, a number before each person: 1, 2, 3, and so on. |
| Contact card | Hover over a person to see the name, the email, and the handles. |
Click a person with an email to write to them. A person with no name, email, or handle and no http or https image_url does not show.
Other places on-call shows​
The md/v1/oncall list also shows, as a row of pictures:
- In the dashboard side panel of an environment and of an instance in it, and of an environment or instance that you cannot view.
- On a No access node on the canvas, for an environment that you cannot view, so you know whom to ask. Without an on-call list, the node shows the groups that have access.
A row shows up to 6 people. The others are under a +N button. This list does not follow the Widgets button.
The alphaInstanceOncall field of a resource returns the on-call list of the environment that produced it. Anyone with resource:view on the resource can read it.
Scorecards​
A scorecard gives each instance a level, such as gold, and a score from 0 to 100, and rolls them up to environments and projects. The scorecards automation writes these keys. See Scorecards for each key's schema.
The UI shows a scorecard's name with its first letter in upper case and _ and - as spaces: production-readiness shows as Production readiness.
| Level pill | Looks like | Score |
|---|---|---|
| Green | 80 or more | |
| Amber | 50 to 79 | |
| Red | Under 50 | |
| Gray | No score, in a roll-up |
A scorecard whose evaluated_at is more than 24 hours ago shows at half opacity, and its time says stale.
Instance scorecards​
md/v1/scorecard/<scorecard> on an instance shows in two places.
Canvas. A level pill next to the instance name. When an instance has more than one scorecard, the pill shows the first one by name. Its tooltip shows the scorecard and the level, then the message, or the id, of each failed check, or No failed checks.
Signals tab. A Scorecards card, with one row for each scorecard, sorted by name. A row shows the name, the level pill, the score, the counts such as 3 passed · 1 failed · 0 unknown, and when it was evaluated. Show 4 checks lists each check with a passed, failed, or unknown icon, its id, and its message.
The same card shows these instance keys:
| Key | Shows |
|---|---|
md/v1/pending | When changed is true, a warning: Configuration changes from 2h ago are not deployed., with the time from changed_at. Without changed_at: Configuration changes are not deployed. |
md/v1/delivery | Delivery, last 30 days: 12 deployments · 8.3% failed · median 4m 12s · last completed. Each optional part shows only when its field is set. |
md/v1/reliability | Reliability, last 30 days: 4 alarms · 0 firing · 1h 2m in alarm · median recovery 5m 0s |
md/v1/currency | Currency: 1.2.0 → 1.4.0 · 2 versions behind · 14 days behind |
The number of days in Delivery and Reliability is window_days. The card does not show rolled_back, automated, last_completed_at, incidents, last_fired_at, latest_published_at, or deployed_at.
Environment scorecards and parity​
md/v1/scorecard/<scorecard> and md/v1/parity on an environment show in a panel at the top of the canvas legend, above your notes.
- Each scorecard shows its name, the level pill, the number of instances, the count at each level such as
2 gold · 2 silver · 1 bronze,Lowest level: bronze, and when it was evaluated. - Parity shows
1 difference from billing-prod, each item's instance and field with its message, and when it was checked.
Project scorecards and ownership​
md/v1/scorecard/<scorecard> and md/v1/ownership on a project show in a Scorecards card on the project's Overview tab.
- Each scorecard shows the same row as on an environment.
- Ownership shows the names of the groups, or
No owning groups, and the number of members, such as6 members.
The web app does not show md/v1/ownership on an environment. Read it with alphaWidgetsForScopes or mass alpha stash get.
Inputs of a widget that you add​
The widget editor has one row for each input. In each row:
- Stash: choose whose stash to read.
- Key: choose a key from the list, or type one. You can type a key that has no value yet.
- Path: for a JSON entry, choose a field, or Whole value. When the key has no value yet, type the fields, separated by commas.
The last column shows the current value, such as ✓ degraded, or why the input has no value:
| Status | Meaning |
|---|---|
| Choose a key | The input is required and has no key. |
| Optional | The input is optional and has no key. |
| No value yet | The key has no value, has expired, or is sensitive. |
| Not a valid key | The key has characters other than letters, digits, and _ . / -. |
| Not a number, Not a whole number, Not text, Not a list | The value has the wrong type. |
| Not a JSON entry | You chose a path, but the entry is TEXT. |
| Path not found | The JSON value does not have that field. |
You can save the widget when every required input has a valid key. The widget shows only when every required input has a value of the right type.
Open Data this widget reads at the top of the editor to see the inputs, the automatic md/v1/ key and its fields, and a mass alpha stash set command. Under Or use your own stash keys, the editor gives example entries. Then set the inputs tells you which key and path to choose for each input.
| Input type | Accepted values |
|---|---|
| number | A JSON number, or a text value such as 42, -3, or 12.5 |
| integer | A whole number, as a JSON number or as text such as 3 |
| string | Text |
| array | A JSON list |
| Added to | Stashes you can choose |
|---|---|
| An instance | project, environment, component, instance |
| A line | project, environment, source, destination |
| An environment | project, environment |