EXTENDED DOCUMENTATION

SaaS Stack Integration

Morpheus is intentionally SaaS-heavy outside the TEE. The goal is to minimize self-managed control-plane code and reserve the confidential VMs for execution only.

Current Managed Stack

  1. Cloudflare
    • edge gateway
    • control plane
    • queues
    • workflows
    • DNS / routes
  2. Upstash Redis
    • shared rate limiting
    • idempotency and replay suppression helpers
  3. Supabase
    • durable job and application state
  4. Vercel
    • web UI and backend routes
  5. Sentry
    • browser and server error tracking
  6. Checkly
    • API and browser synthetics
  7. Better Stack
    • heartbeats, uptime, telemetry shipping
  8. Grafana Cloud
    • optional deep relayer metrics only

Ownership Boundaries

Cloudflare

Cloudflare owns the first two layers of the production design:

  • edge ingress
  • control-plane auth and validation
  • queue-backed execution lanes:
    • text
      oracle_request
    • text
      feed_tick
  • workflow-backed orchestration lanes:
    • text
      callback_broadcast
    • text
      automation_execute

Key files:

  • text
    deploy/cloudflare/morpheus-edge-gateway/worker.mjs
  • text
    deploy/cloudflare/morpheus-control-plane/worker.mjs
  • text
    deploy/cloudflare/morpheus-control-plane/workflow-runtime.mjs

Upstash Redis

Upstash is the shared external memory for:

  • edge and backend rate limits
  • replay-safe locks
  • request-guard helpers

Key files:

  • text
    workers/phala-worker/src/platform/upstash.js
  • text
    workers/phala-worker/src/platform/request-guards.js
  • text
    apps/web/lib/upstash.ts
  • text
    apps/web/lib/rate-limit.ts

Sentry

Sentry is the primary application error tracker for the Next.js surface.

Key files:

  • text
    apps/web/instrumentation.ts
  • text
    apps/web/instrumentation-client.ts
  • text
    apps/web/sentry.server.config.ts
  • text
    apps/web/sentry.edge.config.ts

Checkly

Checkly owns active synthetic verification for:

  • oracle web
  • control plane
  • edge gateway
  • selected AA frontend surfaces

Key files:

  • text
    monitoring/checkly/README.md
  • text
    scripts/checkly-sync-api-checks.mjs
  • text
    scripts/checkly-sync-browser-checks.mjs

Better Stack

Better Stack is the preferred operations layer for:

  • cron heartbeats
  • relayer heartbeats
  • public uptime monitors
  • log shipping / telemetry

Key files:

  • text
    scripts/betterstack-sync-heartbeats.mjs
  • text
    scripts/betterstack-sync-monitors.mjs
  • text
    scripts/betterstack-sync-sources.mjs
  • text
    workers/morpheus-relayer/src/betterstack-log-sink.js

Grafana Cloud

Grafana Cloud is optional. It exists for deeper relayer metrics when Better Stack heartbeats and telemetry are not enough.

Key files:

  • text
    workers/morpheus-relayer/src/prometheus.js
  • text
    workers/morpheus-relayer/src/metrics-server.js
  • text
    monitoring/grafana/README.md

For the current project size and operational goals:

  • use Sentry for exceptions
  • use Checkly for synthetic health
  • use Better Stack for uptime, heartbeats, and telemetry
  • keep Grafana Cloud disabled unless you need lower-level relayer metrics

That gives a simpler and cheaper default than running self-managed Prometheus infrastructure.

Required Credentials By Service

Cloudflare

  • text
    CLOUDFLARE_API_TOKEN
  • text
    CLOUDFLARE_ACCOUNT_ID
  • text
    CLOUDFLARE_ZONE_ID

Upstash

  • text
    UPSTASH_REDIS_REST_URL
  • text
    UPSTASH_REDIS_REST_TOKEN

Sentry

  • text
    NEXT_PUBLIC_SENTRY_DSN
  • text
    SENTRY_DSN
  • recommended:
    • text
      SENTRY_ORG
    • text
      SENTRY_PROJECT
    • text
      SENTRY_AUTH_TOKEN
    • text
      SENTRY_ENVIRONMENT

Checkly

  • text
    CHECKLY_API_KEY
  • text
    CHECKLY_ACCOUNT_ID
  • text
    CHECKLY_PROJECT_NAME

Better Stack

  • heartbeat URLs
  • text
    MORPHEUS_BETTERSTACK_LOG_INGESTING_HOST
  • text
    MORPHEUS_BETTERSTACK_LOG_SOURCE_TOKEN

Grafana Cloud

  • text
    GRAFANA_CLOUD_PROMETHEUS_PUSH_URL
  • text
    GRAFANA_CLOUD_PROMETHEUS_USERNAME
  • text
    GRAFANA_CLOUD_PROMETHEUS_API_KEY

Sync Commands

bash
npm run sync:checkly
npm run sync:checkly:browser
npm run sync:betterstack
npm run sync:betterstack:monitors
npm run sync:betterstack:sources
npm run export:saas

Rollout Order

  1. Cloudflare
  2. Upstash
  3. Supabase
  4. Sentry
  5. Checkly
  6. Better Stack
  7. Grafana Cloud only if needed

References

CURRENT DESIGNUPDATED FOR DUAL-CVM ARCHITECTURE
Morpheus Oracle