Skip to main content

Widgets

Alpha

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 with stash:view on 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​

KeySet onFormatWidgetAdd by hand
md/v1/healthInstanceJSONStatus dotyes
md/v1/usageInstanceJSONUsage baryes
md/v1/trafficInstanceJSONTraffic on the lines that leave the instanceyes
md/v1/bannerEnvironmentJSONBanneryes
md/v1/linksEnvironmentJSONHeader linksyes
md/v1/urlsInstanceJSONInstance linksno
md/v1/oncallEnvironmentJSONOn callno
md/v1/leaderboardEnvironmentJSONLeaderboardno
md/v1/scorecard/<scorecard>Instance, environment, or projectJSONScorecardsno
md/v1/delivery, md/v1/reliability, md/v1/currency, md/v1/pendingInstanceJSONScorecard factsno
md/v1/parityEnvironmentJSONParityno
md/v1/ownershipProject or environmentJSONOwnershipno

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.

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

What it looks like​

ColorLooks like
greenbilling-dev-app
amberbilling-dev-app
redbilling-dev-app
bluebilling-dev-app
purplebilling-dev-app
graybilling-dev-app
A hex color, such as #7C3AEDbilling-dev-app

Without a color, the state sets the color:

StateColor
healthy, ok, or upGreen
degraded, warning, or recoveringAmber
down, failed, or errorRed
any other stateGray

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.

InputTypeRequiredExample keyPath
statestringyesstatus/health on the instance (TEXT)none
colorstringnostatus/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.

FieldMeaning
valueThe amount in use.
maxThe limit.
labelOptional. The label on the left of the bar, when the entry has no --label.
shell
mass alpha stash set billing-dev-app.md/v1/usage '{"value": 37, "max": 100, "label": "connections"}' --format json

What it looks like​

StateLooks likeValueMeaning
Under 80%billing-dev-appconnections37 / 100{"value": 37, "max": 100, "label": "connections"}A teal bar.
80% to 94%billing-dev-appconnections86 / 100{"value": 86, "max": 100, "label": "connections"}An amber bar.
95% or morebilling-dev-appconnections97 / 100{"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:

shell
mass alpha stash set billing-dev-app.db/connections 37
mass alpha stash set billing-dev-app.db/max_connections 100
InputTypeRequiredExample keyPath
valuenumberyesdb/connections on the instancenone
maxnumberyesdb/max_connections on the instancenone
labelstringnononenone

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.

FieldMeaningInput
rpsRequests per second.rate
errors_5mErrors in the last 5 minutes.errors
p95_msOptional. p95 latency in milliseconds.latency
shell
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​

StateLooks likeValueMeaning
Offapidatabasekey missing or expiredThe line shows as usual.
Idleapidatabase0 rps{"rps": 0, "errors_5m": 0}Rate 0. A thin gray dashed line.
Flowingapidatabase240 rps · 180 ms{"rps": 240, "errors_5m": 0, "p95_ms": 180}Rate above 0 and no errors. A teal line.
Some errorsapidatabase240 rps · 3 err · 180 ms{"rps": 240, "errors_5m": 3, "p95_ms": 180}1 to 9 errors. An amber line.
Many errorsapidatabase240 rps · 42 err · 180 ms{"rps": 240, "errors_5m": 42, "p95_ms": 180}10 or more errors. A red line.
Staleapidatabase240 rps · 180 ms · stalenot updated for 10 minutesThe line fades to half opacity.

The line width follows the rate:

RateWidth
under 103px
10 to 994px
100 to 9996px
1000 or more8px

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.

InputTypeRequiredExample keyPath
ratenumberyesstats/traffic on destination (JSON)rps
errorsintegeryesstats/traffic on destination (JSON)errors_5m
latencynumbernostats/traffic on destination (JSON)p95_ms

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.

FieldMeaning
messageThe banner text.
levelOptional. info (blue, the default), warning (amber), or error (red).
shell
mass alpha stash set billing-dev.md/v1/banner '{"message": "Deploy freeze until Friday", "level": "warning"}' --format json

What it looks like​

StateLooks likeValueMeaning
InfoDatabase upgrade tonight{"message": "Database upgrade tonight"}A blue banner.
WarningDeploy freeze until Friday{"message": "Deploy freeze until Friday", "level": "warning"}An amber banner.
ErrorPayments API is down{"message": "Payments API is down", "level": "error"}A red banner.
Two bannersDeploy freeze until FridayDatabase upgrade tonightmd/v1/banner and a banner that you addedBanners 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:

shell
mass alpha stash set billing-dev.status/maintenance "Database upgrade tonight" --ttl 86400
InputTypeRequiredExample keyPath
messagestringyesstatus/maintenance on the environmentnone
levelstringnononenone

A banner that you add with a level that is not info, warning, or error shows as info.

Link buttons in the environment header, such as a dashboard or a runbook. A button opens its URL in a new tab.

Set on the environment. Format: JSON. Each item in links is one button.

The value must match the md/v1/links schema.

FieldMeaning
links[].labelThe button text.
links[].urlAn http or https URL.
shell
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​

StateLooks likeValueMeaning
One linkbilling / devShop ↗{"links": [{"label": "Shop", "url": "https://shop.example.com"}]}One button.
Two linksbilling / devShop ↗Grafana ↗two items in linksOne button per item.
Not an http URLbilling / devShop ↗{"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:

shell
mass alpha stash set billing-dev.links '{"links": [{"label": "Shop", "url": "https://shop.example.com"}]}' --format json --label "Links"
InputTypeRequiredExample keyPath
linksarrayyeslinks 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.

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.

FieldButton
docs_urlDocs
api_urlAPI
app_urlApp
shell
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.

FieldMeaning
titleOptional. The card's title. The default is On call or Leaderboard.
entriesUp to 25 people, in order. Each has any of a name, an image_url, an email, and handles.
shell
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​

PartShows
TitleThe title, or the default. Click it to collapse or expand the card. Your browser keeps this setting.
PersonA 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.
RankOn the leaderboard, a number before each person: 1, 2, 3, and so on.
Contact cardHover 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 pillLooks likeScore
Greengold80 or more
Ambersilver50 to 79
RedbronzeUnder 50
GraybronzeNo 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:

KeyShows
md/v1/pendingWhen 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/deliveryDelivery, 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/reliabilityReliability, last 30 days: 4 alarms · 0 firing · 1h 2m in alarm · median recovery 5m 0s
md/v1/currencyCurrency: 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 as 6 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:

  1. Stash: choose whose stash to read.
  2. Key: choose a key from the list, or type one. You can type a key that has no value yet.
  3. 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:

StatusMeaning
Choose a keyThe input is required and has no key.
OptionalThe input is optional and has no key.
No value yetThe key has no value, has expired, or is sensitive.
Not a valid keyThe key has characters other than letters, digits, and _ . / -.
Not a number, Not a whole number, Not text, Not a listThe value has the wrong type.
Not a JSON entryYou chose a path, but the entry is TEXT.
Path not foundThe 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 typeAccepted values
numberA JSON number, or a text value such as 42, -3, or 12.5
integerA whole number, as a JSON number or as text such as 3
stringText
arrayA JSON list
Added toStashes you can choose
An instanceproject, environment, component, instance
A lineproject, environment, source, destination
An environmentproject, environment