{
 "id": "service-health",
 "name": "Service health chart",
 "purpose": "One service metric over a day against its objective, with yesterday for comparison, a deploy marker, a data gap and the moment it went wrong in the warning colour.",
 "use_when": [
  "on a status or monitoring page",
  "in an incident or alert view, to show when a metric crossed its objective and whether a deploy came just before"
 ],
 "avoid_when": [
  "comparing amounts across categories: use bar-chart",
  "several headline numbers side by side: use kpi-strip"
 ],
 "type": "chart",
 "style": "technical",
 "width": "medium",
 "tags": {
  "audience": "work",
  "industries": [
   "devtools",
   "saas"
  ],
  "keywords": [
   "observability",
   "latency",
   "sparkline",
   "slo",
   "monitoring"
  ]
 },
 "root": ".odl-service-health",
 "parts": [
  {
   "name": "title",
   "selector": "h3",
   "what": "the metric's name",
   "slot": "text"
  },
  {
   "name": "meta",
   "selector": ".odl-meta",
   "what": "the service and the time window",
   "slot": "text"
  },
  {
   "name": "now",
   "selector": ".odl-now",
   "what": "the latest value, in the warning colour when above objective",
   "slot": "number"
  },
  {
   "name": "status",
   "selector": ".odl-status",
   "what": "a one-line warning and a View alert link",
   "slot": "rich"
  },
  {
   "name": "plot",
   "selector": ".odl-plot svg",
   "what": "the chart: today's line, yesterday dotted, the objective dashed, a no-data band and a deploy line",
   "slot": "media"
  },
  {
   "name": "pins",
   "selector": ".odl-pin",
   "what": "labels on the chart for the top of the scale and the objective",
   "slot": "text"
  },
  {
   "name": "axis",
   "selector": ".odl-axis span",
   "what": "time labels under the chart",
   "slot": "list"
  },
  {
   "name": "key",
   "selector": "figcaption span",
   "what": "one line style and what it means",
   "slot": "list"
  }
 ],
 "data": {
  "type": "object",
  "required": [
   "title",
   "unit",
   "series",
   "objective"
  ],
  "properties": {
   "title": {
    "type": "string",
    "maxLength": 28,
    "part": "title"
   },
   "service": {
    "type": "string",
    "maxLength": 28,
    "part": "meta"
   },
   "window": {
    "type": "string",
    "maxLength": 20,
    "part": "meta"
   },
   "unit": {
    "type": "string",
    "maxLength": 6,
    "part": "now"
   },
   "now": {
    "type": "number",
    "part": "now"
   },
   "objective": {
    "type": "number",
    "part": "pins"
   },
   "scale_max": {
    "type": "number",
    "part": "pins"
   },
   "status": {
    "type": "string",
    "maxLength": 56,
    "part": "status"
   },
   "alert_href": {
    "type": "string",
    "maxLength": 400,
    "part": "status"
   },
   "summary": {
    "type": "string",
    "maxLength": 200,
    "part": "plot"
   },
   "series": {
    "type": "array",
    "minItems": 12,
    "maxItems": 120,
    "part": "plot",
    "items": {
     "type": "object",
     "properties": {
      "value": {
       "type": "number"
      }
     }
    }
   },
   "previous": {
    "type": "array",
    "minItems": 12,
    "maxItems": 120,
    "part": "plot",
    "items": {
     "type": "object",
     "properties": {
      "value": {
       "type": "number"
      }
     }
    }
   },
   "deploy": {
    "type": "object",
    "part": "plot",
    "properties": {
     "at": {
      "type": "number",
      "minimum": 0,
      "maximum": 1
     },
     "label": {
      "type": "string",
      "maxLength": 16
     }
    }
   },
   "axis": {
    "type": "array",
    "minItems": 2,
    "maxItems": 5,
    "part": "axis",
    "items": {
     "type": "object",
     "required": [
      "label"
     ],
     "properties": {
      "label": {
       "type": "string",
       "maxLength": 6
      }
     }
    }
   },
   "gaps": {
    "type": "array",
    "minItems": 0,
    "maxItems": 3,
    "part": "plot",
    "items": {
     "type": "object",
     "required": [
      "from",
      "to"
     ],
     "properties": {
      "from": {
       "type": "number",
       "minimum": 0,
       "maximum": 1
      },
      "to": {
       "type": "number",
       "minimum": 0,
       "maximum": 1
      }
     }
    }
   },
   "deploy_at": {
    "type": "string",
    "maxLength": 80
   }
  }
 },
 "states": {
  "shown": [
   "above objective",
   "missing data",
   "deploy marker"
  ],
  "edge": {
   "empty": {
    "status": "handled",
    "evidence": "data-od-list",
    "how": "the Smart UI renderer puts one plain 'Nothing to show yet.' line in an empty list"
   },
   "loading": {
    "status": "handled",
    "evidence": "data-od-slot",
    "how": "the Smart UI renderer draws each marked slot as a quiet block of its size while the data arrives; the static file shows the filled part"
   },
   "error": {
    "status": "not_built",
    "how": "if the metric cannot be read, swap the warning line for an alert-banners error and leave the plot empty"
   },
   "disabled": {
    "status": "not_built",
    "how": "nothing here is disabled; leave out View alert when there is no alert to open"
   },
   "overflow": {
    "status": "handled",
    "how": "in a narrow box the plot gets shorter, the value moves under the title and the key becomes a three-column grid",
    "evidence": "@container (max-width: 30rem)"
   },
   "long_text": {
    "status": "handled",
    "how": "the value, pins, axis labels and link never wrap; the header and warning line wrap their pieces onto new rows",
    "evidence": "white-space: nowrap"
   },
   "missing_image": {
    "status": "none",
    "how": "the part has no photo"
   }
  }
 },
 "tokens": [
  "--ds-border-width-default",
  "--ds-border-width-emphasis",
  "--ds-color-bg-neutral-subtle",
  "--ds-color-bg-warning-subtle",
  "--ds-color-border-focus",
  "--ds-color-border-separator",
  "--ds-color-border-strong",
  "--ds-color-border-subtle",
  "--ds-color-icon-default",
  "--ds-color-surface-raised",
  "--ds-color-text-link",
  "--ds-color-text-primary",
  "--ds-color-text-secondary",
  "--ds-color-text-tertiary",
  "--ds-color-text-warning",
  "--ds-elevation-raised",
  "--ds-focus-ring-offset",
  "--ds-focus-ring-width",
  "--ds-font-weight-label",
  "--ds-icon-stroke-md",
  "--ds-radius-2",
  "--ds-radius-container",
  "--ds-radius-control",
  "--ds-radius-detail",
  "--ds-radius-full",
  "--ds-radius-nested",
  "--ds-size-icon-sm",
  "--ds-size-target-min",
  "--ds-space-12",
  "--ds-space-2",
  "--ds-space-6",
  "--ds-space-8",
  "--ds-space-inline-md",
  "--ds-space-inline-sm",
  "--ds-space-inline-xs",
  "--ds-space-inset-lg",
  "--ds-space-inset-md",
  "--ds-space-inset-sm",
  "--ds-space-inset-xl",
  "--ds-space-inset-xs",
  "--ds-space-stack-lg",
  "--ds-space-stack-md",
  "--ds-space-stack-sm",
  "--ds-space-stack-xs",
  "--ds-text-body-md",
  "--ds-text-label-lg",
  "--ds-text-label-md",
  "--ds-text-label-sm",
  "--ds-text-title-lg",
  "--ds-text-title-md"
 ],
 "a11y": {
  "summary": "The chart is one image with a sentence that says what it shows; the key spells out each line style, so colour is never the only cue.",
  "roles": [
   "article",
   "banner",
   "img",
   "list"
  ],
  "keyboard": [
   "Tab reaches the View alert link; Enter follows it"
  ],
  "controls": {
   "button": 0,
   "input": 0,
   "link": 1,
   "select": 0,
   "textarea": 0,
   "summary": 0
  },
  "focus_visible": true,
  "reduced_motion": false,
  "min_target": true
 },
 "files": {
  "html": "components/service-health/component.html",
  "bytes": 15645,
  "script": true
 },
 "source": "brand/showcase/product/04-sounding-observability",
 "photos": 0,
 "urls": {
  "html": "https://opendesigner.dev/library/service-health.html",
  "json": "https://opendesigner.dev/library/service-health.json",
  "page": "https://opendesigner.dev/library/service-health/"
 },
 "get": {
  "curl": "curl -fsSLo service-health.html https://opendesigner.dev/library/service-health.html",
  "opendesigner": "python3 path/to/skills/opendesigner/scripts/library.py add service-health --from https://opendesigner.dev",
  "prompt": "Add the OpenDesigner component service-health to this project: https://opendesigner.dev/library/service-health.html. Keep its markup and states; map its --ds-* variables to my tokens."
 }
}
