import { init } from '@untrace/sdk';
const untrace = init({
// Required
apiKey: process.env.UNTRACE_API_KEY,
// Service identification
serviceName: 'my-llm-app',
environment: process.env.NODE_ENV,
version: '1.0.0',
// Routing
routing: {
defaultDestination: 'langfuse',
rules: [
{
name: 'High Cost Analysis',
condition: (trace) => trace.cost > 0.10,
destination: 'langsmith'
}
]
},
// Sampling
samplingRate: 0.1, // 10%
// Privacy
piiDetection: {
enabled: true,
redactionMethod: 'mask'
},
// Performance
maxBatchSize: 100,
exportIntervalMs: 5000,
// Debug
debug: process.env.NODE_ENV === 'development'
});