OtelConfig type configures OpenTelemetry integration for distributed tracing, metrics, and logs.
Type Definition
- TypeScript
- Python
- Rust
Fields
Default Configuration
- TypeScript
- Python
- Rust
Usage Examples
Basic Telemetry Setup
- TypeScript
- Python
- Rust
Disable Telemetry
- TypeScript
- Python
- Rust
Custom Metrics Interval
- TypeScript
- Python
- Rust
With Custom Instrumentation (TypeScript)
- TypeScript
Disable HTTP Auto-Instrumentation
- TypeScript
- Python
- Rust
Full Configuration
- TypeScript
- Python
- Rust
Environment Variables
OpenTelemetry configuration can be controlled via environment variables:OTEL_ENABLED- Enable/disable OTel (true/false/0/1/yes/no/on/off)OTEL_SERVICE_NAME- Service nameSERVICE_VERSION- Service versionSERVICE_NAMESPACE- Service namespaceSERVICE_INSTANCE_ID- Service instance IDIII_BRIDGE_URL- Engine WebSocket URLOTEL_METRICS_ENABLED- Enable/disable metrics
Observability Features
Distributed Tracing
All function invocations are automatically traced with W3C trace context propagation:- Parent-child span relationships across workers
- Automatic trace ID and span ID generation
- Baggage propagation for custom context
Metrics
Automatic metrics collection:- Function invocation count
- Function duration
- Error rate
- Active invocations
- Worker status
Logs
Structured logging with trace correlation:- All logs include trace ID and span ID
- Automatic severity level detection
- Resource attributes (service name, version, etc.)
Best Practices
- Always set service metadata: Provide meaningful
serviceName,serviceVersion, andserviceNamespace - Use environment variables: Configure via env vars for easier deployment
- Production monitoring: Keep telemetry enabled in production for observability
- Custom instrumentation: Add framework-specific instrumentations (Prisma, Express, etc.)
- Metrics tuning: Adjust export interval based on traffic volume