Skip to content

Deployment Architecture

┌─────────────────────┐
Developer Machine │ OpenCode / Zed │
│ JetBrains / Cursor │
│ │ │
│ candela-local │
│ (:8181 / :1234) │
└────────┬────────────┘
│ Bearer token (OIDC via ADC)
┌─────────────────────┐
Google Cloud │ Cloud Run │
│ ┌────────────────┐ │
│ │ Next.js :3000 │ │
│ │ ↕ rewrite │ │
│ │ Go API :8181 │ │
│ └───────┬────────┘ │
└──────────┼──────────┘
┌────────────────┼────────────────┐
▼ ▼ ▼
┌──────────┐ ┌──────────┐ ┌──────────┐
│ BigQuery │ │Firestore │ │Vertex AI │
│ (spans) │ │(budgets) │ │(LLM API) │
└──────────┘ └──────────┘ └──────────┘
ComponentLocationPurpose
Go Backendcmd/candela-serverAPI, LLM proxy, span ingestion, auth, storage
Next.js UIui/Dashboard, trace waterfall, costs, admin
candela-localcmd/candela-localCLI proxy injecting Google credentials for dev tools
candela-sidecarcmd/candela-sidecarLightweight container proxy with Pub/Sub export
Terraformterraform/Cloud Run, BigQuery, Firestore, Firebase, IAM

All cloud resources are managed via Terraform in the terraform/ directory:

FileResources
cloud_run.tfCloud Run service, IAM
firebase.tfFirebase project, Identity Platform, authorized domains
bigquery.tfDataset + spans table (time-partitioned)
firestore.tfFirestore database
iam.tfService account + role bindings
artifact_registry.tfContainer image registry
Terminal window
# Build container image
gcloud builds submit --project $PROJECT -f deploy/cloudbuild.yaml .
# Deploy to Cloud Run
gcloud run services update candela --project $PROJECT --region $REGION \
--image $REGION-docker.pkg.dev/$PROJECT/candela/candela-server:latest
# Apply infrastructure
cd terraform && terraform apply