ssmd-health-metrics
Catalog of all ssmd health metrics — sources, query methods, labels, healthy/unhealthy thresholds. Covers data pipeline Prometheus metrics, HTTP endpoints, infrastructure components, DQ scores, and composite health scoring. Use when checking environment health, interpreting metrics, setting alert thresholds, or building health dashboards.
What this skill does
# ssmd-health-metrics
## Data Pipeline Metrics (Prometheus)
Connectors and archivers expose Prometheus metrics on `:8080/metrics`, scraped by Cloud Monitoring.
### Connector Metrics
| Metric | Type | Labels | Healthy | Unhealthy |
|--------|------|--------|---------|-----------|
| `ssmd_connector_websocket_connected` | Gauge 0/1 | `feed`, `shard` | 1 (all shards) | 0 for >2min |
| `ssmd_connector_messages_total` | Counter | `feed`, `type` | rate > 0 | rate = 0 for >5min |
| `ssmd_connector_idle_seconds` | Gauge | `feed` | < 300s | > 300s |
| `ssmd_connector_markets_subscribed` | Gauge | `feed`, `shard` | > 0 | 0 |
| `ssmd_connector_shards_total` | Gauge | `feed` | matches config | mismatch |
### Archiver Metrics
| Metric | Type | Labels | Healthy | Unhealthy |
|--------|------|--------|---------|-----------|
| `ssmd_archiver_messages_total` | Counter | `feed`, `stream` | rate > 0 | rate = 0 for >5min |
| `ssmd_archiver_gaps_total` | Counter | `feed`, `stream` | rate = 0 | rate > 0 |
| `ssmd_archiver_validation_failures_total` | Counter | `feed`, `stream` | rate = 0 | rate > 0 |
| `ssmd_archiver_parse_failures_total` | Counter | `feed`, `stream` | rate = 0 | rate > 0 |
### Querying via Cloud Monitoring (gcloud CLI)
```bash
gcloud monitoring time-series list \
--project=massive-acrobat-227416 \
--filter='metric.type="prometheus.googleapis.com/ssmd_connector_websocket_connected/gauge"' \
--interval-start-time=$(date -u -v-1H +%Y-%m-%dT%H:%M:%SZ)
```
### Querying via port-forward
Rust containers have no wget/curl. Use port-forward + local curl:
```bash
kubectl port-forward -n ssmd deploy/kalshi-crypto-connector 8080:8080 &
sleep 2 && curl -s http://localhost:8080/metrics | grep -E 'websocket_connected|idle_seconds|messages_total' && kill %1
```
## HTTP Health Endpoints
| Component | Deployment | Port | Health Path | Healthy | Unhealthy |
|-----------|-----------|------|-------------|---------|-----------|
| Connector | `kalshi-crypto-connector` | 8080 | `/health` | 200 + `connected:true` | 503 or `stale` |
| Connector | `kraken-futures-connector` | 8080 | `/health` | 200 + `connected:true` | 503 or `stale` |
| Connector | `polymarket-connector` | 8080 | `/health` | 200 + `connected:true` | 503 or `stale` |
| Archiver | `kalshi-crypto-archiver` | 8080 | `/health` | 200 | 503 |
| Archiver | `kraken-futures-archiver` | 8080 | `/health` | 200 | 503 |
| Archiver | `polymarket-archiver` | 8080 | `/health` | 200 | 503 |
| data-ts | `ssmd-data-ts` | 8080 | `/health` | `{"status":"ok"}` | error |
| data-ts (API) | `ssmd-data-ts` | 8080 | `/v1/markets/lookup` | 200 + JSON | 401/500 |
Connectors and archivers require `kubectl port-forward`. data-ts is also accessible via LoadBalancer from allowed CIDRs (home IPs) — no port-forward needed: `curl -s http://<LB-IP>:8080/health`. The `/v1/markets/lookup` endpoint requires `Authorization: Bearer <api-key>` with `datasets:read` scope and serves as an end-to-end health probe (API + DB).
## Infrastructure Components
| Component | Resource | Health Check | Healthy | Unhealthy |
|-----------|----------|-------------|---------|-----------|
| NATS | StatefulSet `nats-0` (ns: nats) | `kubectl exec -n nats deploy/nats-box -- nats server check jetstream` | OK | error/timeout |
| NATS streams | — | `kubectl exec -n nats deploy/nats-box -- nats stream ls` | msgs increasing, last msg recent | stale |
| Postgres | StatefulSet `ssmd-postgres-0` | data-ts `/health` endpoint | `{"status":"ok"}` | error |
| Redis | Deployment `ssmd-redis` | `kubectl exec -n ssmd deploy/ssmd-redis -- redis-cli ping` | PONG | error/timeout |
| Operator | Deployment `ssmd-operator` | `kubectl get deploy ssmd-operator -n ssmd` | available = desired | 0 available |
| CDC | Deployment `ssmd-cdc` | `kubectl get deploy ssmd-cdc -n ssmd` | 1/1 Running | restart/crash |
## DQ Scores
Source: `dq_daily_scores` table. See `ssmd-dq-checks` skill for full 13-check catalog.
| Grade | Score | Meaning |
|-------|-------|---------|
| GREEN | >= 98 | Pipeline healthy |
| YELLOW | >= 85 | Minor issues |
| RED | < 85 | Investigate promptly |
## Composite Health Score (CLI)
Source: `ssmd health daily` command.
Weights: 20% Kalshi + 15% Kraken + 10% Polymarket + 15% Funding + 5% Archive + 15% Completeness + 10% Parquet + 10% SLA
Hard RED overrides: stream no data, connector score 0, funding >1h old, no archiver sync in 24h.
## Cloud Monitoring Alerts
Defined in `terraform/gke-prod/monitoring.tf`:
| Alert | Condition | Severity |
|-------|-----------|----------|
| WebSocket disconnected | `websocket_connected < 1` for > 2min | Critical |
| Message rate zero | `messages_total` rate = 0 for > 5min | Warning |
## Known Metric Quirks
1. **Ghost shards**: After connector restarts, old shard metrics persist. DQ `connection_uptime` takes min across shards, so ghost shards drag scores down.
2. **Polymarket coverage gaps**: Activity concentrates in US hours. Coverage < 100% on 15-min slot checks may be normal.
3. **u64 underflow in parquet-gen**: `parse_batch_dropped` for fanout types can show values > 2^63. DQ treats as 0. Upstream fix pending.
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.