Observability
ClawCentral integrates multiple observability services for monitoring and analytics. This page documents the available integrations and their configuration.
Overview
| Service | Purpose | Environment |
|---|---|---|
| LangSmith | LLM tracing and debugging | Worker runtime |
| Microsoft Clarity | Web analytics and session recordings | Control UI |
| Google Analytics 4 | Web analytics | Control UI |
LangSmith Tracing
LangSmith provides tracing for LLM calls, useful for debugging agent behavior and analyzing token usage.
Configuration
Set these environment variables in your Worker:
| Variable | Required | Description |
|---|---|---|
LANGSMITH_API_KEY | Yes | Your LangSmith API key |
LANGCHAIN_PROJECT | No | Project name (default: default) |
LANGCHAIN_TRACING_V2 | Yes | Set to true to enable tracing |
Local Development
Add to .dev.vars:
LANGSMITH_API_KEY=lsv2_pt_...
LANGCHAIN_PROJECT=my-project
LANGCHAIN_TRACING_V2=true
Production
Set secrets via wrangler:
wrangler secret put LANGSMITH_API_KEY
wrangler secret put LANGCHAIN_PROJECT
wrangler secret put LANGCHAIN_TRACING_V2
Behavior
- All LLM calls are traced automatically when enabled
- Traces are fire-and-forget (non-blocking)
- Failed trace submissions are silently ignored
Microsoft Clarity
Clarity provides session recordings, heatmaps, and web analytics for the Control UI.
Configuration
Set these Vite environment variables:
| Variable | Required | Description |
|---|---|---|
VITE_CLARITY_PROJECT_ID | Yes | Clarity project ID |
Local Development
Add to .env.development or .env.production:
VITE_CLARITY_PROJECT_ID=your-project-id
Behavior
- Only loads in production builds (
import.meta.env.PROD) - Tracks user interactions, rage clicks, and session recordings
- No configuration needed in the Worker — client-side only
Google Analytics 4
GA4 provides standard web analytics for the Control UI.
Configuration
| Variable | Required | Description |
|---|---|---|
VITE_GA_MEASUREMENT_ID | Yes | GA4 measurement ID (e.g., G-XXXXXXXXXX) |
VITE_GSC_VERIFICATION | No | Google Search Console verification content |
Local Development
Add to .env.production:
VITE_GA_MEASUREMENT_ID=G-XXXXXXXXXX
VITE_GSC_VERIFICATION=your-verification-code
Behavior
- Only loads in production builds
VITE_GSC_VERIFICATIONinjects a verification meta tag (safe in all environments)- Standard pageview and event tracking
Google Search Console
For SEO verification, set VITE_GSC_VERIFICATION to inject the verification meta tag:
VITE_GSC_VERIFICATION=your-verification-code
This adds <meta name="google-site-verification" content="your-verification-code"> to the page head.
Related
- Environment Variables — Full environment configuration guide
- Debugging — Debugging tools and techniques