// conductor.config.ts
import { defineConfig } from '@ensemble-edge/conductor'
export default defineConfig({
observability: {
// Logging configuration
logging: {
enabled: true,
level: 'info', // 'debug' | 'info' | 'warn' | 'error'
format: 'json', // JSON for Workers Logs indexing
// Fields to automatically include in all logs
context: ['requestId', 'executionId', 'ensembleName', 'agentName'],
// Sensitive fields to redact (replaced with [REDACTED])
redact: ['password', 'apiKey', 'token', 'authorization', 'secret'],
// Events to log automatically
events: [
'request', // HTTP requests
'response', // HTTP responses
'agent:start', // Agent execution start
'agent:complete', // Agent completion
'agent:error', // Agent errors
],
},
// Analytics Engine metrics
metrics: {
enabled: true,
binding: 'ANALYTICS', // Must match wrangler.toml
track: [
'ensemble:execution', // Ensemble duration/success
'agent:execution', // Agent duration/success
'http:request', // HTTP request stats
'error', // Error counts
],
},
// Optional: External observability (Datadog, Honeycomb, etc.)
opentelemetry: {
enabled: false,
endpoint: 'https://api.honeycomb.io',
headers: { 'x-honeycomb-team': '${HONEYCOMB_API_KEY}' },
samplingRate: 1.0,
},
// Track AI token usage for cost analysis
trackTokenUsage: true,
},
})