Operations

Mainnet monitoring and alerting

Production mainnet billing is live on Base mainnet USDC. These checks watch paid x402 route health without changing payment behavior.

Current production mode: Base mainnet USDC billing beta on primitive402.dev.
status.json is the live source Billing policy Mainnet readiness Mainnet monitoring

Checks to run

  • GET /health and GET /ready for process and readiness health.
  • GET /status.json for billing_mode=mainnet-beta, mainnet_billing_enabled=true, network=eip155:8453, and Base mainnet USDC.
  • pnpm discovery:check --baseUrl https://primitive402.dev for discovery readiness.
  • pnpm x402:paid-route-matrix --baseUrl https://primitive402.dev for unpaid paid-route metadata across all seven routes.
  • pnpm monitor:mainnet --baseUrl https://primitive402.dev for a concise PASS/WARN/FAIL summary.
  • Private /admin/metrics for paidX402Calls, paymentRequiredCalls, paid route errors, rateLimitedCalls, botProbeCalls, and p95 latency.

Alert signals

  • /ready not returning 200 is critical.
  • /status.json not reporting mainnet beta values is critical.
  • Any unpaid /x402/v1/* route returning non-402, wrong network, wrong asset, wrong payTo, or wrong resource URL is critical.
  • CDP/facilitator auth, verification, settlement failure, or missing PAYMENT-RESPONSE is critical.
  • Paid route errors, unexpected non-2xx paid retries, rate-limit spikes, and p95 latency above the chosen threshold are warnings unless repeated or user-impacting.
  • paidX402Calls unexpectedly flat while paymentRequiredCalls rises is a warning.
  • botProbeCalls spikes are informational unless they affect real routes.
  • Database readiness failure is critical.

Optional webhooks

MONITOR_WEBHOOK_URL="https://monitor.example/webhook" \
MONITOR_ALERT_MIN_SEVERITY="warn" \
ADMIN_METRICS_TOKEN="<secret>" \
pnpm monitor:mainnet --baseUrl https://primitive402.dev

Webhook alerting is optional and env-gated. Payloads include service name, base URL, severity, timestamp, summary, and failing checks. They do not include admin tokens, CDP secrets, private keys, raw payment headers, seed phrases, or raw user input.

Railway and external monitors

  • Use Railway health checks for /ready if appropriate.
  • Configure Railway Observability Dashboard CPU, RAM, disk, and network monitors if available on the current plan.
  • Configure Railway project webhooks for deploy failures or alerts if useful.
  • Keep app-level x402 route checks separate from infrastructure monitors.
  • Consider external uptime checks for /health, /ready, /status.json, and unpaid x402 route checks.

Repository docs

Markdown source: docs/ops/mainnet-monitoring.md.