Skip to main content

Overview

Daytona provides built-in observability features including OpenTelemetry (OTEL) integration, telemetry tracking, and metrics collection for monitoring sandbox operations and performance.

OpenTelemetry Integration

Daytona SDK supports OpenTelemetry for distributed tracing of all sandbox operations.

Enable OTEL Tracing

Environment Variable Configuration

Enable OTEL using environment variables:

Automatic Span Creation

When OTEL is enabled, the SDK automatically creates spans for:
  • Sandbox creation and management
  • File operations
  • Process execution
  • Git operations
  • Network requests
  • Code execution

Using Async Disposal

For Node.js applications, use async disposal to ensure traces are flushed:

OTEL Collector Configuration

Daytona uses a custom OpenTelemetry Collector for processing telemetry data.

Collector Components

The Daytona OTEL Collector includes:
  1. OTLP Receiver: Accepts traces, metrics, and logs via HTTP
  2. Daytona Exporter: Routes telemetry to organization-specific endpoints
  3. ClickHouse Exporter: Stores telemetry data for analysis

Collector Configuration

Custom OTLP Endpoint

Configure a custom OTLP endpoint:

Telemetry and Metrics

SDK Telemetry

The SDK automatically tracks:

Trace Attributes

Spans include attributes such as:

Monitoring Sandbox State

Check Sandbox Status

Monitor Backup State

Monitor Lifecycle Configuration

Error Tracking

Monitor Error States

Custom Error Handling

Monitoring Best Practices

  1. Enable OTEL in production: Get visibility into all SDK operations.
  2. Set up dashboards: Use tools like Grafana to visualize telemetry data.
  3. Monitor resource usage: Track CPU, memory, and disk utilization.
  4. Track lifecycle events: Monitor auto-stop, auto-archive, and auto-delete events.
  5. Alert on errors: Set up alerts for sandboxes in error state.
  6. Use labels for filtering: Add labels to sandboxes for easier monitoring and grouping.
  7. Monitor costs: Track sandbox usage across regions and teams.

Observability Stack

Example Dashboard Metrics

Health Checks

The OTEL Collector provides health check endpoints:

Data Retention

Telemetry data retention in ClickHouse:
Adjust based on your monitoring and compliance requirements.