Skip to content

Deployment

The Log10x Console is a lightweight React SPA backed by serverless infrastructure. This guide covers architecture, deployment, and troubleshooting.

For application features and usage, see Console App.

Architecture

graph LR
    U["<div style='font-size:13px'>👤 User</div>"] --> C["<div style='font-size:13px'>🖥️ Console</div><div style='font-size:10px'>CloudFront + S3</div>"]
    C --> A["<div style='font-size:13px'>🔐 Auth</div><div style='font-size:10px'>Auth0 / OIDC</div>"]
    C --> L["<div style='font-size:13px'>⚡ API</div><div style='font-size:10px'>Lambda + Gateway</div>"]
    L --> P["<div style='font-size:13px'>📊 Prometheus</div><div style='font-size:10px'>AMP / Self-hosted</div>"]
    P --> G["<div style='font-size:13px'>📈 Grafana</div><div style='font-size:10px'>AMG / Self-hosted</div>"]
    L --> AI["<div style='font-size:13px'>🤖 AI</div><div style='font-size:10px'>Optional</div>"]

    classDef user fill:#6366f1,stroke:#4f46e5,color:#fff,rx:6
    classDef console fill:#2563eb,stroke:#1d4ed8,color:#fff,rx:6
    classDef auth fill:#7c3aed,stroke:#6d28d9,color:#fff,rx:6
    classDef api fill:#059669,stroke:#047857,color:#fff,rx:6
    classDef prom fill:#ea580c,stroke:#c2410c,color:#fff,rx:6
    classDef grafana fill:#d946ef,stroke:#c026d3,color:#fff,rx:6
    classDef ai fill:#0891b2,stroke:#0e7490,color:#fff,rx:6

    class U user
    class C console
    class A auth
    class L api
    class P prom
    class G grafana
    class AI ai
Component Purpose
🖥️ Console Web UI for managing keys, environments, and settings
🔐 Auth Identity provider - pluggable (Auth0, Okta, Azure AD)
API Lambda functions for user management and Prometheus proxy
📊 Prometheus Time-series storage for 10x Engine metrics
📈 Grafana ROI Analytics dashboards
🤖 AI Optional analysis for cost insights

Deployment Options

Use the fully-managed Log10x infrastructure at console.log10x.com.

Component Endpoint Notes
🖥️ Console console.log10x.com Web UI
⚡ Metrics API prometheus.log10x.com Prometheus queries
⚡ User API api.log10x.com User management, AI
🔐 Auth auth.log10x.com Auth0-managed
📈 Grafana Embedded in Console AMG-backed

Staging Endpoints:

Component Endpoint
⚡ Metrics API prometheus-staging.log10x.com
⚡ User API api-staging.log10x.com

Setup:

  1. Sign in at console.log10x.com
  2. Generate an API key
  3. Configure 10x Engine with your key and environment ID
  4. Metrics flow automatically to dashboards

Deploy all components to your own infrastructure for full data control.

Prerequisites:

  • Terraform 1.0+
  • AWS CLI configured
  • Auth0 account (free tier works)

Components:

Resource Terraform Module Notes
🔐 Auth0 terraform/auth0 Applications, connections, actions
🖥️ Console terraform/console S3 + CloudFront
⚡ API terraform/prometheus-gateway Lambda + API Gateway
📊 Prometheus Your choice AMP or self-hosted
📈 Grafana Your choice AMG or self-hosted

1. Deploy Auth0 Configuration:

cd terraform/auth0
cp terraform.tfvars.example terraform.tfvars
# Edit terraform.tfvars with your Auth0 credentials
terraform init
terraform apply

See terraform/auth0/README.md for detailed setup instructions.

2. Deploy Console:

cd terraform/console
terraform init
terraform apply

3. Deploy API:

cd terraform/prometheus-gateway
terraform init
terraform apply

For environments with no external network access.

Component K8s Resource Notes
🖥️ Console Deployment + Service Nginx static files
⚡ API Deployment + Service Go binary
🔐 Auth Keycloak or internal OIDC No external IdP
💾 Storage K8s Secrets + ConfigMaps No external database

See Authentication > Kubernetes for K8s-native secret management.

Configuration

Environment Variables

Variable Required Description
AUTH_PROVIDER Yes auth0 or oidc
AUTH_KEY_STORE Yes auth0, dynamodb, postgres, or kubernetes
AUTH0_DOMAIN If Auth0 Auth0 tenant domain
AUTH0_CLIENT_ID If Auth0 Application client ID
PROMETHEUS_ENDPOINT Yes Prometheus remote write URL

See Authentication for full configuration reference.

Terraform Variables

Key variables in terraform/console/variables.tf:

variable "auth0_domain" {
  description = "Auth0 tenant domain"
}

variable "auth0_client_id" {
  description = "Auth0 application client ID"
}

variable "api_base_url" {
  description = "Backend API URL (prometheus.log10x.com)"
}

Troubleshooting

JSON Parse Error: Unexpected token '<'

The Console receives HTML instead of JSON from the API.

Cause Solution
API Gateway not deployed Run terraform apply in terraform/console/
Lambda function error Check CloudWatch Logs for the user-service-go function
CORS misconfiguration Verify Access-Control-Allow-Origin header in API Gateway
Console Blank Screen
Cause Solution
CloudFront cache stale Run aws cloudfront create-invalidation --distribution-id $ID --paths '/*'
S3 bucket permissions Verify bucket policy allows public read
JavaScript error Check browser console (F12) for specific errors
Login Redirect Loop
Cause Solution
Auth0 callback URL missing Add https://your-domain.com/callback to Auth0 Allowed Callbacks
Cookie domain mismatch Verify cookie domain matches console domain
API Key Not Working
Cause Solution
Key expired/rotated Generate a new key from the Console
Wrong environment Verify environment ID matches the API key's scope
Network/firewall Ensure 10x Engine can reach the backend
Metrics Not Appearing in Grafana
Cause Solution
Remote write endpoint wrong Verify Prometheus endpoint URL in 10x config
Authentication failed Check API key in 10x Engine config
Environment ID mismatch Ensure environment labels match Grafana filters
Pre-Deployment Checklist

Before deploying Console changes:

  • [ ] Test locally by opening index.html in browser
  • [ ] Verify API endpoints respond with JSON (not HTML 404)
  • [ ] Check Auth0 configuration matches environment
  • [ ] Run terraform plan to preview infrastructure changes
  • [ ] After deploy, invalidate CloudFront cache

Debugging

Check API Response

Test the API endpoint directly:

curl -s -H "X-10X-Auth: YOUR_KEY" \
  https://prometheus.log10x.com/api/v1/query?query=up | jq .
Verify Auth0 Configuration
  1. Login to Auth0 Dashboard
  2. Navigate to Applications > Your App
  3. Check Allowed Callback URLs includes your Console URL
  4. Check Allowed Logout URLs includes your Console URL
Check CloudWatch Logs

View recent Lambda logs:

aws logs tail /aws/lambda/user-service-go --follow

Search for errors:

aws logs filter-log-events \
  --log-group-name /aws/lambda/user-service-go \
  --filter-pattern "ERROR"

Resources

Resource Link
Backend Repo log-10x/backend
Auth0 Terraform terraform/auth0
Console Terraform terraform/console
Lambda Functions lambdas/
Grafana Dashboards grafana/dashboards