NATS JetStream
NATS JetStream is the message queue used for inter-service event delivery in the Crawbl platform. Usage events no longer flow through NATS — they are enqueued as River jobs directly inside the orchestrator and written to ClickHouse in-process.
Connection Details
| Property | Value |
|---|---|
| Service name | backend-nats |
| Namespace | backend |
| Port | 4222 (NATS client) |
| Chart | Bitnami NATS v1.2.9 |
| ArgoCD sync wave | 5 (data layer) |
| Replicas | 1 (dev) |
| JetStream storage | File-based, 2Gi PVC |
Getting credentials
kubectl get secret backend-nats-auth -n backend \
-o jsonpath='{.data}' | jq -r 'to_entries[] | "\(.key): \(.value | @base64d)"'
Role in the Platform
NATS is used for event delivery between platform components. The usage analytics pipeline no longer goes through NATS — usage events are now enqueued as River jobs inside the orchestrator and written directly to ClickHouse:
Agent Runtime → gRPC UsageEvent → Orchestrator → River (usage_write queue) → ClickHouse
Connecting to NATS
Port-forward
kubectl port-forward svc/backend-nats 4222:4222 -n backend
Check stream status (using nats CLI)
nats stream info CRAWBL_USAGE --server=nats://localhost:4222
View pending messages
nats stream view CRAWBL_USAGE --server=nats://localhost:4222 --last=5
Debugging
Check NATS pod
kubectl get pods -n backend -l app.kubernetes.io/name=nats
View NATS logs
kubectl logs -n backend -l app.kubernetes.io/name=nats --tail=50
Common issues
| Symptom | Likely Cause | Fix |
|---|---|---|
| Storage full | JetStream exceeded 2Gi | Check stream info; increase PVC or reduce retention |
| Connection refused | Secret mismatch | Verify backend-nats-auth secret |
What's next: See Billing & Usage for the full pipeline, or ClickHouse for the analytics database.