This runbook establishes the official maintainer procedure for managing Vercel environments, credential ownership, preview validation, health checks, data staleness verification, and instant deployment rollback for LumenMap.
LumenMap relies on environment variables to authenticate with Google Cloud BigQuery (Hubble dataset) and tune server caching.
Important
Never record or commit secret values (such as raw JSON keys or base64 credential strings) into the repository. Environment variables must be configured through the Vercel Project Dashboard or local .env.local files.
| Variable | Environment | Format / Value Type | Default / Recommended | Purpose |
|---|---|---|---|---|
GOOGLE_APPLICATION_CREDENTIALS |
Local | File path string (e.g., ./gcp-sa.json) |
None | Path to local GCP service account JSON key file for local development. |
GCP_SERVICE_ACCOUNT_KEY |
Preview, Production, Local | Base64-encoded string | None | Base64-encoded GCP Service Account JSON key. Required for Vercel serverless functions where local filesystem paths do not exist. |
CACHE_TTL_SECONDS |
Local, Preview, Production | Integer (seconds) | 900 (15 minutes) |
Controls in-memory server cache TTL for BigQuery activity query results to manage BigQuery cost and rate limits. |
+-----------------------+------------------------------------------+---------------------------------------------+
| Environment | Credential Source | Cache TTL (`CACHE_TTL_SECONDS`) |
+-----------------------+------------------------------------------+---------------------------------------------+
| Local Development | GOOGLE_APPLICATION_CREDENTIALS file path | 900 (or lower for debugging) |
| | or GCP_SERVICE_ACCOUNT_KEY | |
+-----------------------+------------------------------------------+---------------------------------------------+
| Vercel Preview | GCP_SERVICE_ACCOUNT_KEY (Base64) | 300 to 900 (allows fast preview validation) |
| (PRs & Branches) | Staging/Preview GCP Service Account | |
+-----------------------+------------------------------------------+---------------------------------------------+
| Vercel Production | GCP_SERVICE_ACCOUNT_KEY (Base64) | 900 (15 minutes for BigQuery cost control) |
| (Main branch) | Production GCP Service Account | |
+-----------------------+------------------------------------------+---------------------------------------------+
- Credential Ownership: GCP Service Account credentials must be generated in the Google Cloud Console under a project with access to BigQuery dataset
crypto-stellar.crypto_stellar_dbt. The service account requires theBigQuery User(orBigQuery Data Viewer+BigQuery Job User) role. - Access Control: Only repository maintainers with Admin or Owner access to the Vercel project may add or update
GCP_SERVICE_ACCOUNT_KEYin Vercel Project Settings. - Cache Management: The in-memory cache (
CACHE_TTL_SECONDS) mitigates query costs. In production, maintainers must ensureCACHE_TTL_SECONDSis set to900or higher to prevent excessive BigQuery execution fees during traffic spikes.
Before promoting any change to production, validate the build in a Vercel Preview environment:
- Open a Pull Request on GitHub. Vercel will automatically trigger a preview build.
- Confirm that the Vercel deployment check on the PR passes with a green checkmark.
Execute a smoke check against the Preview URL generated by Vercel:
# Set your Vercel preview domain
PREVIEW_URL="https://lumenmap-git-your-branch-lumenmap.vercel.app"
# Test activity endpoint for 1-day period
curl -sS "${PREVIEW_URL}/api/activity?period=1d" | jq .Verify the returned JSON payload contains all required fields:
period:"1d"startandend: Valid ISO 8601 timestampskpis:totalOps,sorobanShare,topCategory,activeContractstreemaps: Containseventsandactorsroot nodescategories,contracts,accounts,sorobanFunctions,sorobanFunctionContractsusdcCategories,usdcAccounts
- Endpoint:
GET /api/activity?period=1d - Expected Status:
200 OK - Expected Content-Type:
application/json
If GCP_SERVICE_ACCOUNT_KEY is missing or corrupted:
- HTTP Status:
500 Internal Server Error - JSON Error Output:
{ "error": "BigQuery credentials are required. Set GOOGLE_APPLICATION_CREDENTIALS in .env.local" } - Remediation: Re-encode the GCP service account JSON key using base64 and update
GCP_SERVICE_ACCOUNT_KEYin Vercel Environment Variables:base64 -i gcp-sa.json | tr -d '\n'
Hubble data updates in intraday batches on BigQuery. To verify data freshness:
- Fetch
/api/activity?period=1d. - Inspect
endtimestamp in the response. It should match the current date/time within standard intraday refresh latency. - If data appears stale, verify that the server cache key is expiring properly (
CACHE_TTL_SECONDS) and that Next.js route/api/activity/route.tsspecifiesexport const dynamic = "force-dynamic".
When a production incident occurs (e.g., runtime 500 errors, broken treemap rendering, or failed BigQuery integrations), follow this rollback procedure.
- Log into Vercel Dashboard.
- Select the LumenMap project.
- Navigate to the Deployments tab.
- Locate the last Production deployment that was known to be healthy prior to the incident.
- Click the
...(overflow menu) next to the target deployment and select Instant Rollback (or Promote to Production). - Confirm the prompt. Production traffic will immediately be routed to the selected deployment artifact.
If CLI access is available:
# Link to project if needed
vercel link
# Execute instant rollback to previous deployment
vercel rollback <known-good-deployment-id-or-url>To permanently revert the codebase on main:
git checkout main
git pull origin main
git revert HEAD -m "revert: rollback broken production deployment"
git push origin mainImmediately after initiating a rollback, complete the following verification steps:
- HTTP 200 Verification: Run
curl -i -sS https://<production-domain>/api/activity?period=1dand confirmHTTP/2 200. - UI Treemap Verification: Open
https://<production-domain>in a browser and confirm:- Treemap tiles render correctly for both "Operation Types" and "Accounts & Contracts".
- Metric switching between "Operation Count" and "USDC Volume" functions without errors.
- Detail panel updates when clicking tiles.
- Log Inspection: Check Vercel Function Logs under Vercel Dashboard -> Logs to ensure zero server-side exceptions or unhandled promise rejections.
- Incident Communication: Document the incident root cause, rollback deployment ID, and remediation steps in an incident issue.