跳到主要内容

Observability

ClawCentral integrates multiple observability services for monitoring and analytics. This page documents the available integrations and their configuration.

Overview

ServicePurposeEnvironment
LangSmithLLM tracing and debuggingWorker runtime
Microsoft ClarityWeb analytics and session recordingsControl UI
Google Analytics 4Web analyticsControl 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:

VariableRequiredDescription
LANGSMITH_API_KEYYesYour LangSmith API key
LANGCHAIN_PROJECTNoProject name (default: default)
LANGCHAIN_TRACING_V2YesSet 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:

VariableRequiredDescription
VITE_CLARITY_PROJECT_IDYesClarity 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

VariableRequiredDescription
VITE_GA_MEASUREMENT_IDYesGA4 measurement ID (e.g., G-XXXXXXXXXX)
VITE_GSC_VERIFICATIONNoGoogle 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_VERIFICATION injects 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.