{
  "docVersion": 1,
  "id": "template-metrics-observability-platform",
  "name": "Observability — metrics pipeline",
  "purpose": "Service fleet emits metrics through a budget-enforcing funnel into a stream; sketch aggregation feeds a hot TSDB; cron rollups downsample into cold object storage; one query API serves dashboards and alerts.",
  "nodes": {
    "fleet": {
      "type": "k8s",
      "label": "Service Fleet",
      "x": 0,
      "y": 240,
      "runtime": "500 pods · SDK metrics",
      "patterns": [
        "autoscale"
      ]
    },
    "funnel": {
      "type": "gateway",
      "label": "Ingest Funnel",
      "x": 260,
      "y": 240,
      "runtime": "validate · budget · shed",
      "color": "amber",
      "notes": "Enforces per-team cardinality budgets at the door. A runaway user_id label gets rejected here, not discovered on the invoice."
    },
    "log": {
      "type": "stream",
      "label": "Metrics Stream",
      "x": 520,
      "y": 240,
      "runtime": "partitioned by series",
      "patterns": [
        "sharded"
      ]
    },
    "agg": {
      "type": "worker",
      "label": "Sketch Aggregator",
      "x": 780,
      "y": 240,
      "runtime": "t-digest · HLL · counters",
      "color": "purple",
      "notes": "Sketches merge associatively — shard-local digests combine into exact-enough global percentiles."
    },
    "hot": {
      "type": "timeseries",
      "label": "Hot TSDB",
      "x": 1040,
      "y": 120,
      "runtime": "raw · 24h retention",
      "patterns": [
        "replicated"
      ]
    },
    "roll": {
      "type": "cron",
      "label": "Rollup Jobs",
      "x": 1040,
      "y": 360,
      "runtime": "1s→1m→1h downsampling"
    },
    "cold": {
      "type": "storage",
      "label": "Cold Tier",
      "x": 1300,
      "y": 360,
      "runtime": "13 months · object store",
      "patterns": [
        "backup"
      ]
    },
    "api": {
      "type": "bff",
      "label": "Query API",
      "x": 1300,
      "y": 120,
      "runtime": "hot + cold merge"
    },
    "alert": {
      "type": "alerting",
      "label": "Alerting",
      "x": 1560,
      "y": 120,
      "runtime": "SLO burn rates"
    }
  },
  "edges": {
    "e1": {
      "from": "fleet",
      "to": "funnel",
      "fromSide": "right",
      "toSide": "left",
      "label": "metrics · 2M pts/s",
      "animated": true,
      "patterns": [
        "batch",
        "compressed"
      ]
    },
    "e2": {
      "from": "funnel",
      "to": "log",
      "fromSide": "right",
      "toSide": "left",
      "label": "admitted series",
      "animated": true,
      "patterns": [
        "load-shed",
        "rate-limit"
      ]
    },
    "e3": {
      "from": "log",
      "to": "agg",
      "fromSide": "right",
      "toSide": "left",
      "label": "consume",
      "patterns": [
        "ordered"
      ]
    },
    "e4": {
      "from": "agg",
      "to": "hot",
      "fromSide": "right",
      "toSide": "left",
      "label": "digests",
      "patterns": [
        "idempotent"
      ]
    },
    "e5": {
      "from": "hot",
      "to": "roll",
      "fromSide": "bottom",
      "toSide": "top",
      "label": "age out",
      "style": "dashed"
    },
    "e6": {
      "from": "roll",
      "to": "cold",
      "fromSide": "right",
      "toSide": "left",
      "label": "downsampled tiers"
    },
    "e7": {
      "from": "hot",
      "to": "api",
      "fromSide": "right",
      "toSide": "left",
      "label": "recent"
    },
    "e8": {
      "from": "cold",
      "to": "api",
      "fromSide": "top",
      "toSide": "bottom",
      "label": "history",
      "style": "dashed"
    },
    "e9": {
      "from": "api",
      "to": "alert",
      "fromSide": "right",
      "toSide": "left",
      "label": "evaluate rules",
      "animated": true
    }
  },
  "texts": {
    "t1": {
      "x": 0,
      "y": 460,
      "text": "the two observability killers, both handled at ingest:\n· cardinality budget (labels × values is your real bill)\n· sketches over raw (percentiles that merge correctly)",
      "color": "amber",
      "size": 12
    }
  },
  "meta": {
    "createdAt": "2026-07-13T09:00:00.000Z",
    "modifiedAt": "2026-07-13T09:00:00.000Z"
  }
}