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
46 changes: 23 additions & 23 deletions packages/viewer/src/demo/observability.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"layout": "grid",
"panes": [
{
"title": "SLOs",
"type": "component",
"content": "{\"type\":\"Stack\",\"props\":{\"gap\":\"sm\",\"p\":\"md\"},\"children\":[{\"type\":\"Group\",\"props\":{\"justify\":\"space-between\",\"align\":\"center\"},\"children\":[{\"type\":\"Title\",\"props\":{\"order\":4},\"children\":\"Service SLOs — 28d\"},{\"type\":\"Badge\",\"props\":{\"color\":\"green\",\"variant\":\"light\"},\"children\":\"All within budget\"}]},{\"type\":\"SimpleGrid\",\"props\":{\"cols\":3,\"spacing\":\"xs\"},\"children\":[{\"type\":\"Stack\",\"props\":{\"align\":\"center\",\"gap\":2},\"children\":[{\"type\":\"RingProgress\",\"props\":{\"size\":118,\"thickness\":11,\"roundCaps\":true,\"sections\":[{\"value\":99.95,\"color\":\"teal\"}],\"label\":{\"type\":\"Text\",\"props\":{\"ta\":\"center\",\"fw\":700,\"size\":\"lg\"},\"children\":\"99.95%\"}}},{\"type\":\"Text\",\"props\":{\"c\":\"dimmed\",\"size\":\"xs\",\"ta\":\"center\"},\"children\":\"Availability · target 99.9\"}]},{\"type\":\"Stack\",\"props\":{\"align\":\"center\",\"gap\":2},\"children\":[{\"type\":\"RingProgress\",\"props\":{\"size\":118,\"thickness\":11,\"roundCaps\":true,\"sections\":[{\"value\":82,\"color\":\"yellow\"}],\"label\":{\"type\":\"Text\",\"props\":{\"ta\":\"center\",\"fw\":700,\"size\":\"lg\"},\"children\":\"82%\"}}},{\"type\":\"Text\",\"props\":{\"c\":\"dimmed\",\"size\":\"xs\",\"ta\":\"center\"},\"children\":\"Latency budget left\"}]},{\"type\":\"Stack\",\"props\":{\"align\":\"center\",\"gap\":2},\"children\":[{\"type\":\"RingProgress\",\"props\":{\"size\":118,\"thickness\":11,\"roundCaps\":true,\"sections\":[{\"value\":36,\"color\":\"red\"}],\"label\":{\"type\":\"Text\",\"props\":{\"ta\":\"center\",\"fw\":700,\"size\":\"lg\"},\"children\":\"36%\"}}},{\"type\":\"Text\",\"props\":{\"c\":\"dimmed\",\"size\":\"xs\",\"ta\":\"center\"},\"children\":\"Error budget used\"}]}]},{\"type\":\"Divider\",\"props\":{\"my\":2}},{\"type\":\"SimpleGrid\",\"props\":{\"cols\":3,\"spacing\":\"xs\"},\"children\":[{\"type\":\"Stack\",\"props\":{\"gap\":0},\"children\":[{\"type\":\"Text\",\"props\":{\"c\":\"dimmed\",\"size\":\"xs\"},\"children\":\"Requests\"},{\"type\":\"Text\",\"props\":{\"fw\":700},\"children\":\"1.24M\"}]},{\"type\":\"Stack\",\"props\":{\"gap\":0},\"children\":[{\"type\":\"Text\",\"props\":{\"c\":\"dimmed\",\"size\":\"xs\"},\"children\":\"p95 latency\"},{\"type\":\"Text\",\"props\":{\"fw\":700},\"children\":\"214 ms\"}]},{\"type\":\"Stack\",\"props\":{\"gap\":0},\"children\":[{\"type\":\"Text\",\"props\":{\"c\":\"dimmed\",\"size\":\"xs\"},\"children\":\"Error rate\"},{\"type\":\"Text\",\"props\":{\"fw\":700,\"c\":\"red\"},\"children\":\"0.42%\"}]}]}]}"
},
{
"title": "Latency",
"type": "vegalite",
"content": "{\"$schema\":\"https://vega.github.io/schema/vega-lite/v6.json\",\"title\":{\"text\":\"Latency by percentile (ms)\",\"subtitle\":\"last 24h · dash + label = percentile (color-independent)\",\"anchor\":\"start\"},\"width\":\"container\",\"height\":300,\"data\":{\"values\":[{\"h\":0,\"ms\":83,\"pct\":\"p50\"},{\"h\":1,\"ms\":86,\"pct\":\"p50\"},{\"h\":2,\"ms\":90,\"pct\":\"p50\"},{\"h\":3,\"ms\":93,\"pct\":\"p50\"},{\"h\":4,\"ms\":94,\"pct\":\"p50\"},{\"h\":5,\"ms\":95,\"pct\":\"p50\"},{\"h\":6,\"ms\":94,\"pct\":\"p50\"},{\"h\":7,\"ms\":93,\"pct\":\"p50\"},{\"h\":8,\"ms\":90,\"pct\":\"p50\"},{\"h\":9,\"ms\":87,\"pct\":\"p50\"},{\"h\":10,\"ms\":83,\"pct\":\"p50\"},{\"h\":11,\"ms\":79,\"pct\":\"p50\"},{\"h\":12,\"ms\":75,\"pct\":\"p50\"},{\"h\":13,\"ms\":73,\"pct\":\"p50\"},{\"h\":14,\"ms\":71,\"pct\":\"p50\"},{\"h\":15,\"ms\":70,\"pct\":\"p50\"},{\"h\":16,\"ms\":71,\"pct\":\"p50\"},{\"h\":17,\"ms\":72,\"pct\":\"p50\"},{\"h\":18,\"ms\":75,\"pct\":\"p50\"},{\"h\":19,\"ms\":78,\"pct\":\"p50\"},{\"h\":20,\"ms\":82,\"pct\":\"p50\"},{\"h\":21,\"ms\":86,\"pct\":\"p50\"},{\"h\":22,\"ms\":89,\"pct\":\"p50\"},{\"h\":23,\"ms\":92,\"pct\":\"p50\"},{\"h\":0,\"ms\":226,\"pct\":\"p95\"},{\"h\":1,\"ms\":235,\"pct\":\"p95\"},{\"h\":2,\"ms\":243,\"pct\":\"p95\"},{\"h\":3,\"ms\":248,\"pct\":\"p95\"},{\"h\":4,\"ms\":250,\"pct\":\"p95\"},{\"h\":5,\"ms\":248,\"pct\":\"p95\"},{\"h\":6,\"ms\":244,\"pct\":\"p95\"},{\"h\":7,\"ms\":236,\"pct\":\"p95\"},{\"h\":8,\"ms\":226,\"pct\":\"p95\"},{\"h\":9,\"ms\":216,\"pct\":\"p95\"},{\"h\":10,\"ms\":205,\"pct\":\"p95\"},{\"h\":11,\"ms\":195,\"pct\":\"p95\"},{\"h\":12,\"ms\":187,\"pct\":\"p95\"},{\"h\":13,\"ms\":182,\"pct\":\"p95\"},{\"h\":14,\"ms\":180,\"pct\":\"p95\"},{\"h\":15,\"ms\":181,\"pct\":\"p95\"},{\"h\":16,\"ms\":186,\"pct\":\"p95\"},{\"h\":17,\"ms\":194,\"pct\":\"p95\"},{\"h\":18,\"ms\":203,\"pct\":\"p95\"},{\"h\":19,\"ms\":214,\"pct\":\"p95\"},{\"h\":20,\"ms\":225,\"pct\":\"p95\"},{\"h\":21,\"ms\":235,\"pct\":\"p95\"},{\"h\":22,\"ms\":243,\"pct\":\"p95\"},{\"h\":23,\"ms\":248,\"pct\":\"p95\"},{\"h\":0,\"ms\":431,\"pct\":\"p99\"},{\"h\":1,\"ms\":446,\"pct\":\"p99\"},{\"h\":2,\"ms\":456,\"pct\":\"p99\"},{\"h\":3,\"ms\":460,\"pct\":\"p99\"},{\"h\":4,\"ms\":457,\"pct\":\"p99\"},{\"h\":5,\"ms\":447,\"pct\":\"p99\"},{\"h\":6,\"ms\":432,\"pct\":\"p99\"},{\"h\":7,\"ms\":413,\"pct\":\"p99\"},{\"h\":8,\"ms\":391,\"pct\":\"p99\"},{\"h\":9,\"ms\":370,\"pct\":\"p99\"},{\"h\":10,\"ms\":350,\"pct\":\"p99\"},{\"h\":11,\"ms\":334,\"pct\":\"p99\"},{\"h\":12,\"ms\":324,\"pct\":\"p99\"},{\"h\":13,\"ms\":320,\"pct\":\"p99\"},{\"h\":14,\"ms\":323,\"pct\":\"p99\"},{\"h\":15,\"ms\":332,\"pct\":\"p99\"},{\"h\":16,\"ms\":347,\"pct\":\"p99\"},{\"h\":17,\"ms\":366,\"pct\":\"p99\"},{\"h\":18,\"ms\":388,\"pct\":\"p99\"},{\"h\":19,\"ms\":409,\"pct\":\"p99\"},{\"h\":20,\"ms\":429,\"pct\":\"p99\"},{\"h\":21,\"ms\":445,\"pct\":\"p99\"},{\"h\":22,\"ms\":456,\"pct\":\"p99\"},{\"h\":23,\"ms\":460,\"pct\":\"p99\"}]},\"encoding\":{\"x\":{\"field\":\"h\",\"type\":\"quantitative\",\"title\":\"hour\",\"axis\":{\"tickMinStep\":3}},\"color\":{\"field\":\"pct\",\"type\":\"nominal\",\"title\":null,\"scale\":{\"domain\":[\"p50\",\"p95\",\"p99\"],\"range\":[\"#22c55e\",\"#fbbf24\",\"#ef4444\"]}}},\"layer\":[{\"mark\":{\"type\":\"line\",\"point\":false,\"tooltip\":true,\"interpolate\":\"monotone\",\"strokeWidth\":2},\"encoding\":{\"y\":{\"field\":\"ms\",\"type\":\"quantitative\",\"title\":\"ms\"},\"strokeDash\":{\"field\":\"pct\",\"type\":\"nominal\",\"title\":null,\"scale\":{\"domain\":[\"p50\",\"p95\",\"p99\"],\"range\":[[1,0],[6,3],[2,3]]}}}},{\"transform\":[{\"window\":[{\"op\":\"last_value\",\"field\":\"h\",\"as\":\"lastH\"}],\"frame\":[null,null],\"groupby\":[\"pct\"]},{\"filter\":\"datum.h === datum.lastH\"}],\"mark\":{\"type\":\"text\",\"align\":\"left\",\"baseline\":\"middle\",\"dx\":6,\"fontWeight\":\"bold\",\"fontSize\":12},\"encoding\":{\"y\":{\"field\":\"ms\",\"type\":\"quantitative\"},\"text\":{\"field\":\"pct\"}}}]}"
},
{
"title": "Top errors",
"type": "component",
"content": "{\"type\":\"Stack\",\"props\":{\"gap\":\"sm\",\"p\":\"md\"},\"children\":[{\"type\":\"Title\",\"props\":{\"order\":4},\"children\":\"Top errors — 1h\"},{\"type\":\"Table\",\"props\":{\"withTableBorder\":true,\"striped\":true,\"data\":{\"head\":[\"error\",\"service\",\"count\",\"share\"],\"body\":[[\"504 upstream timeout\",\"checkout\",\"1,204\",\"38%\"],[\"TypeError: undefined id\",\"auth\",\"642\",\"20%\"],[\"429 rate limited\",\"search\",\"511\",\"16%\"],[\"DB deadlock\",\"orders\",\"388\",\"12%\"],[\"NULL payment_intent\",\"payments\",\"203\",\"6%\"]]}}},{\"type\":\"Alert\",\"props\":{\"color\":\"red\",\"title\":\"Spike: 504s on checkout (+312% vs 1h ago)\"},\"children\":\"Correlates with deploy v2.18.0 at 14:02 — consider rollback.\"}]}"
},
{
"title": "Throughput",
"type": "vegalite",
"content": "{\"$schema\":\"https://vega.github.io/schema/vega-lite/v6.json\",\"title\":{\"text\":\"Requests / min\",\"subtitle\":\"last 24h\",\"anchor\":\"start\"},\"width\":\"container\",\"height\":300,\"data\":{\"values\":[{\"h\":0,\"rpm\":1060},{\"h\":1,\"rpm\":1140},{\"h\":2,\"rpm\":1212},{\"h\":3,\"rpm\":1270},{\"h\":4,\"rpm\":1307},{\"h\":5,\"rpm\":1320},{\"h\":6,\"rpm\":1308},{\"h\":7,\"rpm\":1272},{\"h\":8,\"rpm\":1216},{\"h\":9,\"rpm\":1144},{\"h\":10,\"rpm\":1064},{\"h\":11,\"rpm\":984},{\"h\":12,\"rpm\":911},{\"h\":13,\"rpm\":853},{\"h\":14,\"rpm\":815},{\"h\":15,\"rpm\":800},{\"h\":16,\"rpm\":811},{\"h\":17,\"rpm\":845},{\"h\":18,\"rpm\":901},{\"h\":19,\"rpm\":972},{\"h\":20,\"rpm\":1051},{\"h\":21,\"rpm\":1132},{\"h\":22,\"rpm\":1205},{\"h\":23,\"rpm\":1264}]},\"mark\":{\"type\":\"area\",\"line\":{\"color\":\"#60a5fa\"},\"color\":{\"x1\":1,\"y1\":1,\"x2\":1,\"y2\":0,\"gradient\":\"linear\",\"stops\":[{\"offset\":0,\"color\":\"rgba(96,165,250,0.05)\"},{\"offset\":1,\"color\":\"rgba(96,165,250,0.5)\"}]},\"tooltip\":true,\"interpolate\":\"monotone\"},\"encoding\":{\"x\":{\"field\":\"h\",\"type\":\"quantitative\",\"title\":\"hour\"},\"y\":{\"field\":\"rpm\",\"type\":\"quantitative\",\"title\":\"req/min\"}}}"
}
]
"layout": "grid",
"panes": [
{
"title": "SLOs",
"type": "component",
"content": "{\"type\":\"Stack\",\"props\":{\"gap\":\"sm\",\"p\":\"md\"},\"children\":[{\"type\":\"Group\",\"props\":{\"justify\":\"space-between\",\"align\":\"center\"},\"children\":[{\"type\":\"Title\",\"props\":{\"order\":4},\"children\":\"Service SLOs — 28d\"},{\"type\":\"Badge\",\"props\":{\"color\":\"green\",\"variant\":\"light\"},\"children\":\"All within budget\"}]},{\"type\":\"SimpleGrid\",\"props\":{\"cols\":3,\"spacing\":\"xs\"},\"children\":[{\"type\":\"Stack\",\"props\":{\"align\":\"center\",\"gap\":2},\"children\":[{\"type\":\"RingProgress\",\"props\":{\"size\":118,\"thickness\":11,\"roundCaps\":true,\"sections\":[{\"value\":99.95,\"color\":\"teal\"}],\"label\":{\"type\":\"Text\",\"props\":{\"ta\":\"center\",\"fw\":700,\"size\":\"lg\"},\"children\":\"99.95%\"}}},{\"type\":\"Text\",\"props\":{\"c\":\"dimmed\",\"size\":\"xs\",\"ta\":\"center\"},\"children\":\"Availability · target 99.9\"}]},{\"type\":\"Stack\",\"props\":{\"align\":\"center\",\"gap\":2},\"children\":[{\"type\":\"RingProgress\",\"props\":{\"size\":118,\"thickness\":11,\"roundCaps\":true,\"sections\":[{\"value\":82,\"color\":\"yellow\"}],\"label\":{\"type\":\"Text\",\"props\":{\"ta\":\"center\",\"fw\":700,\"size\":\"lg\"},\"children\":\"82%\"}}},{\"type\":\"Text\",\"props\":{\"c\":\"dimmed\",\"size\":\"xs\",\"ta\":\"center\"},\"children\":\"Latency budget left\"}]},{\"type\":\"Stack\",\"props\":{\"align\":\"center\",\"gap\":2},\"children\":[{\"type\":\"RingProgress\",\"props\":{\"size\":118,\"thickness\":11,\"roundCaps\":true,\"sections\":[{\"value\":36,\"color\":\"red\"}],\"label\":{\"type\":\"Text\",\"props\":{\"ta\":\"center\",\"fw\":700,\"size\":\"lg\"},\"children\":\"36%\"}}},{\"type\":\"Text\",\"props\":{\"c\":\"dimmed\",\"size\":\"xs\",\"ta\":\"center\"},\"children\":\"Error budget used\"}]}]},{\"type\":\"Divider\",\"props\":{\"my\":2}},{\"type\":\"SimpleGrid\",\"props\":{\"cols\":3,\"spacing\":\"xs\"},\"children\":[{\"type\":\"Stack\",\"props\":{\"gap\":0},\"children\":[{\"type\":\"Text\",\"props\":{\"c\":\"dimmed\",\"size\":\"xs\"},\"children\":\"Requests\"},{\"type\":\"Text\",\"props\":{\"fw\":700},\"children\":\"1.24M\"}]},{\"type\":\"Stack\",\"props\":{\"gap\":0},\"children\":[{\"type\":\"Text\",\"props\":{\"c\":\"dimmed\",\"size\":\"xs\"},\"children\":\"p95 latency\"},{\"type\":\"Text\",\"props\":{\"fw\":700},\"children\":\"214 ms\"}]},{\"type\":\"Stack\",\"props\":{\"gap\":0},\"children\":[{\"type\":\"Text\",\"props\":{\"c\":\"dimmed\",\"size\":\"xs\"},\"children\":\"Error rate\"},{\"type\":\"Text\",\"props\":{\"fw\":700,\"c\":\"red\"},\"children\":\"0.42%\"}]}]}]}"
},
{
"title": "Latency",
"type": "vegalite",
"content": "{\"$schema\": \"https://vega.github.io/schema/vega-lite/v6.json\", \"title\": {\"text\": \"Latency by percentile (ms)\", \"subtitle\": \"last 24h · dash + label = percentile (color-independent)\", \"anchor\": \"start\"}, \"width\": \"container\", \"height\": 300, \"data\": {\"values\": [{\"h\": 0, \"ms\": 83, \"pct\": \"p50\"}, {\"h\": 1, \"ms\": 86, \"pct\": \"p50\"}, {\"h\": 2, \"ms\": 90, \"pct\": \"p50\"}, {\"h\": 3, \"ms\": 93, \"pct\": \"p50\"}, {\"h\": 4, \"ms\": 94, \"pct\": \"p50\"}, {\"h\": 5, \"ms\": 95, \"pct\": \"p50\"}, {\"h\": 6, \"ms\": 94, \"pct\": \"p50\"}, {\"h\": 7, \"ms\": 93, \"pct\": \"p50\"}, {\"h\": 8, \"ms\": 90, \"pct\": \"p50\"}, {\"h\": 9, \"ms\": 87, \"pct\": \"p50\"}, {\"h\": 10, \"ms\": 83, \"pct\": \"p50\"}, {\"h\": 11, \"ms\": 79, \"pct\": \"p50\"}, {\"h\": 12, \"ms\": 75, \"pct\": \"p50\"}, {\"h\": 13, \"ms\": 73, \"pct\": \"p50\"}, {\"h\": 14, \"ms\": 71, \"pct\": \"p50\"}, {\"h\": 15, \"ms\": 70, \"pct\": \"p50\"}, {\"h\": 16, \"ms\": 71, \"pct\": \"p50\"}, {\"h\": 17, \"ms\": 72, \"pct\": \"p50\"}, {\"h\": 18, \"ms\": 75, \"pct\": \"p50\"}, {\"h\": 19, \"ms\": 78, \"pct\": \"p50\"}, {\"h\": 20, \"ms\": 82, \"pct\": \"p50\"}, {\"h\": 21, \"ms\": 86, \"pct\": \"p50\"}, {\"h\": 22, \"ms\": 89, \"pct\": \"p50\"}, {\"h\": 23, \"ms\": 92, \"pct\": \"p50\"}, {\"h\": 0, \"ms\": 226, \"pct\": \"p95\"}, {\"h\": 1, \"ms\": 235, \"pct\": \"p95\"}, {\"h\": 2, \"ms\": 243, \"pct\": \"p95\"}, {\"h\": 3, \"ms\": 248, \"pct\": \"p95\"}, {\"h\": 4, \"ms\": 250, \"pct\": \"p95\"}, {\"h\": 5, \"ms\": 248, \"pct\": \"p95\"}, {\"h\": 6, \"ms\": 244, \"pct\": \"p95\"}, {\"h\": 7, \"ms\": 236, \"pct\": \"p95\"}, {\"h\": 8, \"ms\": 226, \"pct\": \"p95\"}, {\"h\": 9, \"ms\": 216, \"pct\": \"p95\"}, {\"h\": 10, \"ms\": 205, \"pct\": \"p95\"}, {\"h\": 11, \"ms\": 195, \"pct\": \"p95\"}, {\"h\": 12, \"ms\": 187, \"pct\": \"p95\"}, {\"h\": 13, \"ms\": 182, \"pct\": \"p95\"}, {\"h\": 14, \"ms\": 180, \"pct\": \"p95\"}, {\"h\": 15, \"ms\": 181, \"pct\": \"p95\"}, {\"h\": 16, \"ms\": 186, \"pct\": \"p95\"}, {\"h\": 17, \"ms\": 194, \"pct\": \"p95\"}, {\"h\": 18, \"ms\": 203, \"pct\": \"p95\"}, {\"h\": 19, \"ms\": 214, \"pct\": \"p95\"}, {\"h\": 20, \"ms\": 225, \"pct\": \"p95\"}, {\"h\": 21, \"ms\": 235, \"pct\": \"p95\"}, {\"h\": 22, \"ms\": 243, \"pct\": \"p95\"}, {\"h\": 23, \"ms\": 248, \"pct\": \"p95\"}, {\"h\": 0, \"ms\": 431, \"pct\": \"p99\"}, {\"h\": 1, \"ms\": 446, \"pct\": \"p99\"}, {\"h\": 2, \"ms\": 456, \"pct\": \"p99\"}, {\"h\": 3, \"ms\": 460, \"pct\": \"p99\"}, {\"h\": 4, \"ms\": 457, \"pct\": \"p99\"}, {\"h\": 5, \"ms\": 447, \"pct\": \"p99\"}, {\"h\": 6, \"ms\": 432, \"pct\": \"p99\"}, {\"h\": 7, \"ms\": 413, \"pct\": \"p99\"}, {\"h\": 8, \"ms\": 391, \"pct\": \"p99\"}, {\"h\": 9, \"ms\": 370, \"pct\": \"p99\"}, {\"h\": 10, \"ms\": 350, \"pct\": \"p99\"}, {\"h\": 11, \"ms\": 334, \"pct\": \"p99\"}, {\"h\": 12, \"ms\": 324, \"pct\": \"p99\"}, {\"h\": 13, \"ms\": 320, \"pct\": \"p99\"}, {\"h\": 14, \"ms\": 323, \"pct\": \"p99\"}, {\"h\": 15, \"ms\": 332, \"pct\": \"p99\"}, {\"h\": 16, \"ms\": 347, \"pct\": \"p99\"}, {\"h\": 17, \"ms\": 366, \"pct\": \"p99\"}, {\"h\": 18, \"ms\": 388, \"pct\": \"p99\"}, {\"h\": 19, \"ms\": 409, \"pct\": \"p99\"}, {\"h\": 20, \"ms\": 429, \"pct\": \"p99\"}, {\"h\": 21, \"ms\": 445, \"pct\": \"p99\"}, {\"h\": 22, \"ms\": 456, \"pct\": \"p99\"}, {\"h\": 23, \"ms\": 460, \"pct\": \"p99\"}]}, \"encoding\": {\"x\": {\"field\": \"h\", \"type\": \"quantitative\", \"title\": \"hour\", \"axis\": {\"tickMinStep\": 3}, \"scale\": {\"domainMax\": 25}}, \"color\": {\"field\": \"pct\", \"type\": \"nominal\", \"title\": null, \"scale\": {\"domain\": [\"p50\", \"p95\", \"p99\"], \"range\": [\"#22c55e\", \"#fbbf24\", \"#ef4444\"]}, \"legend\": null}}, \"layer\": [{\"mark\": {\"type\": \"line\", \"point\": false, \"tooltip\": true, \"interpolate\": \"monotone\", \"strokeWidth\": 2}, \"encoding\": {\"y\": {\"field\": \"ms\", \"type\": \"quantitative\", \"title\": \"ms\"}, \"strokeDash\": {\"field\": \"pct\", \"type\": \"nominal\", \"title\": null, \"scale\": {\"domain\": [\"p50\", \"p95\", \"p99\"], \"range\": [[1, 0], [6, 3], [2, 3]]}, \"legend\": null}}}, {\"transform\": [{\"window\": [{\"op\": \"last_value\", \"field\": \"h\", \"as\": \"lastH\"}], \"frame\": [null, null], \"groupby\": [\"pct\"]}, {\"filter\": \"datum.h === datum.lastH\"}], \"mark\": {\"type\": \"text\", \"align\": \"left\", \"baseline\": \"middle\", \"dx\": 6, \"fontWeight\": \"bold\", \"fontSize\": 12}, \"encoding\": {\"y\": {\"field\": \"ms\", \"type\": \"quantitative\"}, \"text\": {\"field\": \"pct\"}}}]}"
},
{
"title": "Top errors",
"type": "component",
"content": "{\"type\":\"Stack\",\"props\":{\"gap\":\"sm\",\"p\":\"md\"},\"children\":[{\"type\":\"Title\",\"props\":{\"order\":4},\"children\":\"Top errors — 1h\"},{\"type\":\"Table\",\"props\":{\"withTableBorder\":true,\"striped\":true,\"data\":{\"head\":[\"error\",\"service\",\"count\",\"share\"],\"body\":[[\"504 upstream timeout\",\"checkout\",\"1,204\",\"38%\"],[\"TypeError: undefined id\",\"auth\",\"642\",\"20%\"],[\"429 rate limited\",\"search\",\"511\",\"16%\"],[\"DB deadlock\",\"orders\",\"388\",\"12%\"],[\"NULL payment_intent\",\"payments\",\"203\",\"6%\"]]}}},{\"type\":\"Alert\",\"props\":{\"color\":\"red\",\"title\":\"Spike: 504s on checkout (+312% vs 1h ago)\"},\"children\":\"Correlates with deploy v2.18.0 at 14:02 — consider rollback.\"}]}"
},
{
"title": "Throughput",
"type": "vegalite",
"content": "{\"$schema\":\"https://vega.github.io/schema/vega-lite/v6.json\",\"title\":{\"text\":\"Requests / min\",\"subtitle\":\"last 24h\",\"anchor\":\"start\"},\"width\":\"container\",\"height\":300,\"data\":{\"values\":[{\"h\":0,\"rpm\":1060},{\"h\":1,\"rpm\":1140},{\"h\":2,\"rpm\":1212},{\"h\":3,\"rpm\":1270},{\"h\":4,\"rpm\":1307},{\"h\":5,\"rpm\":1320},{\"h\":6,\"rpm\":1308},{\"h\":7,\"rpm\":1272},{\"h\":8,\"rpm\":1216},{\"h\":9,\"rpm\":1144},{\"h\":10,\"rpm\":1064},{\"h\":11,\"rpm\":984},{\"h\":12,\"rpm\":911},{\"h\":13,\"rpm\":853},{\"h\":14,\"rpm\":815},{\"h\":15,\"rpm\":800},{\"h\":16,\"rpm\":811},{\"h\":17,\"rpm\":845},{\"h\":18,\"rpm\":901},{\"h\":19,\"rpm\":972},{\"h\":20,\"rpm\":1051},{\"h\":21,\"rpm\":1132},{\"h\":22,\"rpm\":1205},{\"h\":23,\"rpm\":1264}]},\"mark\":{\"type\":\"area\",\"line\":{\"color\":\"#60a5fa\"},\"color\":{\"x1\":1,\"y1\":1,\"x2\":1,\"y2\":0,\"gradient\":\"linear\",\"stops\":[{\"offset\":0,\"color\":\"rgba(96,165,250,0.05)\"},{\"offset\":1,\"color\":\"rgba(96,165,250,0.5)\"}]},\"tooltip\":true,\"interpolate\":\"monotone\"},\"encoding\":{\"x\":{\"field\":\"h\",\"type\":\"quantitative\",\"title\":\"hour\"},\"y\":{\"field\":\"rpm\",\"type\":\"quantitative\",\"title\":\"req/min\"}}}"
}
]
}
4 changes: 3 additions & 1 deletion plugin/skills/diagram-recipes/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ Compose the knobs; don't ship the bare minimum.
- **Every chart gets context:** `title`+`subtitle`, axis `title`s, `tooltip:true`, and
`width:"container"` — the viewer auto-fits the whole chart (axes + legend) to its pane, so
**don't hardcode a fixed pixel `width`** (it bleeds out of the pane). **Never rely on red/green
alone** — add dashes, labels, or a second channel.
alone** — add dashes, labels, or a second channel. If you label line **ends** directly (a text
layer at the last point), drop the now-redundant `legend` (`legend:null`) AND reserve room with
`x.scale.domainMax` past the last point, or the labels spill off the plot's right edge.
- **Keep node `label`/`sub` concise.** The layout sizes each card to its content and spaces nodes
to avoid overlap, so short, scannable text reads best (and the card stays compact). Pair the
`label` with `icon`/`sub`/`meta` for context — don't ship a bare word.
Expand Down
Loading
Loading