Skip to content

Trace-native CI/CD for AI agents — production failures become regression tests that block the PR. Auto-detect, cluster, freeze into hermetic cases, replay in CI for $0.

4.7 KB
Raw Blame
# ── Tracely environment (copy to .env) ─────────────────────────────────────────
TRACELY_ENV=dev

# Postgres (registry) — async driver for the app, sync for Alembic
DATABASE_URL=postgresql+asyncpg://tracely:tracely@localhost:5432/tracely
ALEMBIC_DATABASE_URL=postgresql+psycopg://tracely:tracely@localhost:5432/tracely

# ClickHouse (events + scores)
# Span store: clickhouse (legacy) | postgres. Set the SAME value on the API and the worker.
# Switch only after `python -m tracely.infrastructure.spans.copy` reports "OK — stores agree".
SPAN_STORE=clickhouse
CLICKHOUSE_HOST=localhost
CLICKHOUSE_PORT=8123
CLICKHOUSE_USER=default
CLICKHOUSE_PASSWORD=
CLICKHOUSE_DATABASE=tracely
# ClickHouse's own telemetry (query_log, trace_log, …) has no TTL by default and nothing reads it;
# a nightly beat sweep caps it. 0 = leave it alone (keep your query_log while debugging).
CH_SYSTEM_LOG_TTL_DAYS=3

# Redis (Celery broker + result backend)
REDIS_URL=redis://localhost:6379/0

# S3 / MinIO (raw OTLP blob = source of truth)
S3_ENDPOINT_URL=http://localhost:9000
S3_REGION=us-east-1
S3_ACCESS_KEY_ID=tracely
S3_SECRET_ACCESS_KEY=tracely-secret
S3_BUCKET=tracely-events
S3_EVENT_PREFIX=events/

# Ingestion tuning
CLICKHOUSE_ASYNC_INSERT=1            # rely on CH server-side batching (Celery has no shared in-proc buffer)
INGESTION_DELAY_SECONDS=0            # OTLP path: no artificial delay (mirrors Langfuse getDelay otel branch)

# ── LLM access ─────────────────────────────────────────────────────────────────
# Every judge, failure-intelligence and meta-analysis call goes through LangChain `create_agent`
# on OpenRouter (embeddings via its OpenAI-compatible /embeddings endpoint) — OPENROUTER_API_KEY
# alone is enough. Blank = the pipeline still runs, but evaluators degrade to no-ops.
OPENROUTER_API_KEY=
# Legacy direct-endpoint fallbacks, used only when no OpenRouter key is set.
# OPENAI_API_KEY=
# LLM_JUDGE_API_KEY=
# Encrypts a workspace's own OpenRouter key (Settings -> LLM key) at rest — only needed once a
# workspace brings its own. Any string >=32 chars; generate with `openssl rand -base64 32`.
# SECRETS_ENCRYPTION_KEY=

# ── Auth & multi-tenancy ───────────────────────────────────────────────────────
# dev   = no human login; the ingest key is the only credential (default, unchanged behavior).
# local = self-host email/password (Railway). Requires SESSION_SECRET. First user = OWNER, then invite-only.
# clerk = hosted SaaS; Clerk owns login/orgs. Requires CLERK_ISSUER (+ frontend Clerk keys).
AUTH_MODE=dev
# Required when AUTH_MODE=local — sign the session JWT. Generate: openssl rand -hex 32
SESSION_SECRET=
SESSION_TTL_SECONDS=604800          # 7 days
SESSION_ISSUER=tracely
# Required when AUTH_MODE=clerk (e.g. https://your-app.clerk.accounts.dev)
CLERK_ISSUER=
# CLERK_JWKS_URL=                    # optional; derived from CLERK_ISSUER when blank
# CLERK_AUDIENCE=                    # optional 'aud' to pin
# CLERK_SECRET_KEY=                  # optional, for Clerk Backend API calls
# FRONTEND_ORIGIN=https://app.example.com   # hosted only: allow direct browser calls (CORS)

# ── Transactional email (Resend) — optional ────────────────────────────────────
# When set, team invites are emailed automatically; when blank, the invite link is shown once in the
# UI for manual sharing (no email sent). Create a key at https://resend.com.
# RESEND_API_KEY=
# Sender identity. The default ([email protected]) only delivers to your own Resend-account
# email — verify a domain at resend.com/domains to email real teammates.
# EMAIL_FROM=Tracely <[email protected]>
# Public URL of the frontend, used to build the accept-invite link in invite emails.
# APP_BASE_URL=http://localhost:3001

# ── Product analytics (PostHog) — optional ────────────────────────────────────
# NEXT_PUBLIC_POSTHOG_KEY=phc_...   # from posthog.com project settings; empty = analytics off

# ── AI Observability (PostHog) — optional, backend ─────────────────────────────
# Same PostHog project token as above. Attaches a CallbackHandler to every judge/assistant/
# simulation LLM call (infrastructure/llm/provider.py); empty = no capture.
# POSTHOG_API_KEY=phc_...
# POSTHOG_HOST=https://us.i.posthog.com