~ knotless Search/
↑↓ move↵ open⇧↵ all results

zat.dev/stream

jetstream v2 in zig · mirror of https://tangled.org/zat.dev/stream

0
0
635 lines · 13.1 KB Raw History
{
 "id": null,
 "uid": "stream-glance",
 "title": "stream / at a glance",
 "tags": [
  "stream",
  "operator"
 ],
 "timezone": "utc",
 "schemaVersion": 39,
 "refresh": "30s",
 "time": {
  "from": "now-6h",
  "to": "now"
 },
 "panels": [
  {
   "datasource": {
    "type": "prometheus",
    "uid": "prometheus"
   },
   "description": "0 during startup rebuild or upstream reconnects; steady ~250-450/s when live",
   "fieldConfig": {
    "defaults": {
     "unit": "ops"
    },
    "overrides": []
   },
   "gridPos": {
    "h": 7,
    "w": 8,
    "x": 0,
    "y": 0
   },
   "id": 1,
   "targets": [
    {
     "datasource": {
      "type": "prometheus",
      "uid": "prometheus"
     },
     "expr": "rate(stream_events_total[2m])",
     "refId": "A"
    }
   ],
   "title": "live tail \u2014 events ingested /s",
   "type": "timeseries"
  },
  {
   "datasource": {
    "type": "prometheus",
    "uid": "prometheus"
   },
   "description": "seconds since the last event witnessed from the relay. this is the metric that catches a wedged upstream front (2026-08-16 bsky.network outage: TCP connected, nothing arriving). green <15s.",
   "fieldConfig": {
    "defaults": {
     "unit": "s",
     "thresholds": {
      "mode": "absolute",
      "steps": [
       {
        "color": "green",
        "value": null
       },
       {
        "color": "yellow",
        "value": 15
       },
       {
        "color": "red",
        "value": 60
       }
      ]
     }
    },
    "overrides": []
   },
   "gridPos": {
    "h": 7,
    "w": 8,
    "x": 8,
    "y": 0
   },
   "id": 2,
   "options": {
    "graphMode": "area",
    "colorMode": "value",
    "reduceOptions": {
     "calcs": [
      "lastNotNull"
     ]
    }
   },
   "targets": [
    {
     "datasource": {
      "type": "prometheus",
      "uid": "prometheus"
     },
     "expr": "time() - jetstream_livestream_last_seen_upstream_event_timestamp_seconds",
     "refId": "A"
    }
   ],
   "title": "upstream freshness",
   "type": "stat"
  },
  {
   "datasource": {
    "type": "prometheus",
    "uid": "prometheus"
   },
   "description": "normally 0. a sustained nonzero rate means the relay is flapping (2026-08-19 12:54Z: ~20/10m during relay instability) \u2014 check upstream before suspecting stream.",
   "fieldConfig": {
    "defaults": {
     "unit": "short"
    },
    "overrides": []
   },
   "gridPos": {
    "h": 7,
    "w": 8,
    "x": 16,
    "y": 0
   },
   "id": 3,
   "targets": [
    {
     "datasource": {
      "type": "prometheus",
      "uid": "prometheus"
     },
     "expr": "increase(jetstream_livestream_reconnects_total[10m])",
     "refId": "A",
     "legendFormat": "reconnects"
    },
    {
     "datasource": {
      "type": "prometheus",
      "uid": "prometheus"
     },
     "expr": "increase(jetstream_livestream_sequence_gaps_total[10m])",
     "refId": "B",
     "legendFormat": "seq gaps"
    }
   ],
   "title": "firehose reconnects (per 10m)",
   "type": "timeseries"
  },
  {
   "datasource": {
    "type": "prometheus",
    "uid": "prometheus"
   },
   "description": "sum across subscribers; scales with subscriber count, so shape matters more than level. brief 1-2s lulls during compaction block rewrites are known (max observed 2.08s) and self-heal.",
   "fieldConfig": {
    "defaults": {
     "unit": "ops"
    },
    "overrides": []
   },
   "gridPos": {
    "h": 7,
    "w": 8,
    "x": 0,
    "y": 7
   },
   "id": 4,
   "targets": [
    {
     "datasource": {
      "type": "prometheus",
      "uid": "prometheus"
     },
     "expr": "sum(rate(jetstream_subscribe_events_sent_total[2m]))",
     "refId": "A"
    }
   ],
   "title": "delivery \u2014 events sent to subscribers /s",
   "type": "timeseries"
  },
  {
   "datasource": {
    "type": "prometheus",
    "uid": "prometheus"
   },
   "description": "live websocket consumers (open, unauthenticated). the eval collector accounts for one or more of these at all times.",
   "fieldConfig": {
    "defaults": {
     "unit": "short",
     "thresholds": {
      "mode": "absolute",
      "steps": [
       {
        "color": "green",
        "value": null
       }
      ]
     }
    },
    "overrides": []
   },
   "gridPos": {
    "h": 7,
    "w": 8,
    "x": 8,
    "y": 7
   },
   "id": 5,
   "options": {
    "graphMode": "area",
    "colorMode": "value",
    "reduceOptions": {
     "calcs": [
      "lastNotNull"
     ]
    }
   },
   "targets": [
    {
     "datasource": {
      "type": "prometheus",
      "uid": "prometheus"
     },
     "expr": "stream_subscribers_active",
     "refId": "A"
    }
   ],
   "title": "subscribers connected",
   "type": "stat"
  },
  {
   "datasource": {
    "type": "prometheus",
    "uid": "prometheus"
   },
   "description": "all archive reads (keyed consumers + fleet). per-key breakdown, throttles, and bucket headroom live on the consumers dashboard.",
   "fieldConfig": {
    "defaults": {
     "unit": "Bps"
    },
    "overrides": []
   },
   "gridPos": {
    "h": 7,
    "w": 8,
    "x": 16,
    "y": 7
   },
   "id": 6,
   "targets": [
    {
     "datasource": {
      "type": "prometheus",
      "uid": "prometheus"
     },
     "expr": "rate(jetstream_getblock_served_bytes_total[5m])",
     "refId": "A",
     "legendFormat": "getBlock"
    }
   ],
   "title": "archive served \u2014 bytes /s",
   "type": "timeseries"
  },
  {
   "datasource": {
    "type": "prometheus",
    "uid": "prometheus"
   },
   "description": "network volume, ~200 MB/s ceiling shared by serving and compaction. sealed archive grows steadily; red = start planning, not start panicking.",
   "fieldConfig": {
    "defaults": {
     "unit": "bytes",
     "thresholds": {
      "mode": "absolute",
      "steps": [
       {
        "color": "red",
        "value": null
       },
       {
        "color": "yellow",
        "value": 200000000000
       },
       {
        "color": "green",
        "value": 500000000000
       }
      ]
     }
    },
    "overrides": []
   },
   "gridPos": {
    "h": 7,
    "w": 8,
    "x": 0,
    "y": 14
   },
   "id": 7,
   "options": {
    "graphMode": "area",
    "colorMode": "value",
    "reduceOptions": {
     "calcs": [
      "lastNotNull"
     ]
    }
   },
   "targets": [
    {
     "datasource": {
      "type": "prometheus",
      "uid": "prometheus"
     },
     "expr": "jetstream_data_dir_free_bytes",
     "refId": "A"
    }
   ],
   "title": "archive disk free",
   "type": "stat"
  },
  {
   "datasource": {
    "type": "prometheus",
    "uid": "prometheus"
   },
   "description": "witnessed-time gap between the sealed tip and the compaction watermark (upstream's paging signal for failed passes). sawtooths up between passes \u2014 cadence is pass (~5.5h) + 4h interval \u2248 9.9h \u2014 and drops to ~0 after each pass. sustained growth past ~14h means passes are failing or stalled; restarts reset the boot-relative pass timer.",
   "fieldConfig": {
    "defaults": {
     "unit": "s",
     "thresholds": {
      "mode": "absolute",
      "steps": [
       {
        "color": "green",
        "value": null
       },
       {
        "color": "yellow",
        "value": 50400
       },
       {
        "color": "red",
        "value": 86400
       }
      ]
     }
    },
    "overrides": []
   },
   "gridPos": {
    "h": 7,
    "w": 8,
    "x": 8,
    "y": 14
   },
   "id": 8,
   "options": {
    "graphMode": "area",
    "colorMode": "value",
    "reduceOptions": {
     "calcs": [
      "lastNotNull"
     ]
    }
   },
   "targets": [
    {
     "datasource": {
      "type": "prometheus",
      "uid": "prometheus"
     },
     "expr": "jetstream_compaction_watermark_lag_seconds",
     "refId": "A"
    }
   ],
   "title": "compaction watermark lag",
   "type": "stat"
  },
  {
   "datasource": {
    "type": "prometheus",
    "uid": "prometheus"
   },
   "description": "any sustained nonzero line is a real defect, not noise. slow-consumer drops are the one benign-ish exception (an abusive or dead-slow client being disconnected on purpose).",
   "fieldConfig": {
    "defaults": {
     "unit": "short"
    },
    "overrides": []
   },
   "gridPos": {
    "h": 7,
    "w": 8,
    "x": 16,
    "y": 14
   },
   "id": 9,
   "targets": [
    {
     "datasource": {
      "type": "prometheus",
      "uid": "prometheus"
     },
     "expr": "rate(stream_pipeline_failures_total[5m])",
     "refId": "A",
     "legendFormat": "pipeline failures"
    },
    {
     "datasource": {
      "type": "prometheus",
      "uid": "prometheus"
     },
     "expr": "rate(jetstream_ingest_append_errors_total[5m])",
     "refId": "B",
     "legendFormat": "append errors"
    },
    {
     "datasource": {
      "type": "prometheus",
      "uid": "prometheus"
     },
     "expr": "rate(jetstream_livestream_decode_errors_total[5m])",
     "refId": "C",
     "legendFormat": "decode errors"
    },
    {
     "datasource": {
      "type": "prometheus",
      "uid": "prometheus"
     },
     "expr": "rate(jetstream_subscribe_encode_errors_total[5m])",
     "refId": "D",
     "legendFormat": "encode errors"
    },
    {
     "datasource": {
      "type": "prometheus",
      "uid": "prometheus"
     },
     "expr": "rate(jetstream_livestream_verify_queue_dropped_events_total[5m])",
     "refId": "E",
     "legendFormat": "verify drops"
    },
    {
     "datasource": {
      "type": "prometheus",
      "uid": "prometheus"
     },
     "expr": "rate(stream_subscribe_cold_stalls_total[5m])",
     "refId": "F",
     "legendFormat": "cold stalls"
    },
    {
     "datasource": {
      "type": "prometheus",
      "uid": "prometheus"
     },
     "expr": "rate(jetstream_subscribe_adversarial_drops_total[5m])",
     "refId": "G",
     "legendFormat": "slow-consumer drops"
    }
   ],
   "title": "faults \u2014 flat zero when healthy",
   "type": "timeseries"
  },
  {
   "datasource": {
    "type": "prometheus",
    "uid": "prometheus"
   },
   "description": "zlay lesson 8 (docs/lessons-from-zlay.md): balanced allocs + growing RSS = glibc arena fragmentation, not a leak. 'free held' is memory glibc holds but has not returned to the OS \u2014 a large, growing gap between rss and live is fragmentation, and MALLOC_ARENA_MAX / allocator choice is the lever. 2026-08-21: RSS floor ratcheted ~2.5 to ~5.7 GiB this way.",
   "fieldConfig": {
    "defaults": {
     "unit": "bytes"
    },
    "overrides": []
   },
   "gridPos": {
    "h": 7,
    "w": 8,
    "x": 0,
    "y": 21
   },
   "id": 10,
   "targets": [
    {
     "datasource": {
      "type": "prometheus",
      "uid": "prometheus"
     },
     "expr": "process_resident_memory_bytes",
     "refId": "A",
     "legendFormat": "rss"
    },
    {
     "datasource": {
      "type": "prometheus",
      "uid": "prometheus"
     },
     "expr": "stream_malloc_system_bytes",
     "refId": "B",
     "legendFormat": "malloc system"
    },
    {
     "datasource": {
      "type": "prometheus",
      "uid": "prometheus"
     },
     "expr": "stream_malloc_system_bytes - stream_malloc_free_total_bytes",
     "refId": "C",
     "legendFormat": "malloc live"
    }
   ],
   "title": "memory \u2014 rss vs malloc live",
   "type": "timeseries"
  },
  {
   "datasource": {
    "type": "prometheus",
    "uid": "prometheus"
   },
   "description": "free-but-held glibc memory across ALL arenas (malloc_info; mallinfo sees only the main arena). this is the slice a tighter MALLOC_ARENA_MAX or a purging allocator could recover.",
   "fieldConfig": {
    "defaults": {
     "unit": "bytes",
     "thresholds": {
      "mode": "absolute",
      "steps": [
       {
        "color": "green",
        "value": null
       },
       {
        "color": "yellow",
        "value": 1000000000
       },
       {
        "color": "red",
        "value": 3000000000
       }
      ]
     }
    },
    "overrides": []
   },
   "gridPos": {
    "h": 7,
    "w": 8,
    "x": 8,
    "y": 21
   },
   "id": 11,
   "options": {
    "graphMode": "area",
    "colorMode": "value",
    "reduceOptions": {
     "calcs": [
      "lastNotNull"
     ]
    }
   },
   "targets": [
    {
     "datasource": {
      "type": "prometheus",
      "uid": "prometheus"
     },
     "expr": "stream_malloc_free_total_bytes",
     "refId": "A"
    }
   ],
   "title": "malloc free held (fragmentation)",
   "type": "stat"
  },
  {
   "datasource": {
    "type": "prometheus",
    "uid": "prometheus"
   },
   "description": "chained 64 MiB glibc arena heaps \u2014 the unit that pins RSS (MALLOC_ARENA_MAX caps arenas, each arena chains heaps; a heap only unmaps when entirely free). 41 observed at the 08-21 ratchet peak.",
   "fieldConfig": {
    "defaults": {
     "unit": "short",
     "thresholds": {
      "mode": "absolute",
      "steps": [
       {
        "color": "green",
        "value": null
       },
       {
        "color": "yellow",
        "value": 24
       },
       {
        "color": "red",
        "value": 48
       }
      ]
     }
    },
    "overrides": []
   },
   "gridPos": {
    "h": 7,
    "w": 8,
    "x": 16,
    "y": 21
   },
   "id": 12,
   "options": {
    "graphMode": "area",
    "colorMode": "value",
    "reduceOptions": {
     "calcs": [
      "lastNotNull"
     ]
    }
   },
   "targets": [
    {
     "datasource": {
      "type": "prometheus",
      "uid": "prometheus"
     },
     "expr": "stream_malloc_arena_heaps",
     "refId": "A"
    }
   ],
   "title": "glibc arena heaps",
   "type": "stat"
  }
 ]
}