Skip to main content
The OtelConfig type configures OpenTelemetry integration for distributed tracing, metrics, and logs.

Type Definition

Fields

Default Configuration

Usage Examples

Basic Telemetry Setup

Disable Telemetry

Custom Metrics Interval

With Custom Instrumentation (TypeScript)

Disable HTTP Auto-Instrumentation

Full Configuration

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 name
  • SERVICE_VERSION - Service version
  • SERVICE_NAMESPACE - Service namespace
  • SERVICE_INSTANCE_ID - Service instance ID
  • III_BRIDGE_URL - Engine WebSocket URL
  • OTEL_METRICS_ENABLED - Enable/disable metrics
Example:

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

  1. Always set service metadata: Provide meaningful serviceName, serviceVersion, and serviceNamespace
  2. Use environment variables: Configure via env vars for easier deployment
  3. Production monitoring: Keep telemetry enabled in production for observability
  4. Custom instrumentation: Add framework-specific instrumentations (Prisma, Express, etc.)
  5. Metrics tuning: Adjust export interval based on traffic volume