Skip to main content

Overview

Daytona provides built-in OpenTelemetry (OTEL) integration for monitoring sandbox resource utilization. Export metrics to popular observability platforms like Grafana Cloud, New Relic, or any OTLP-compatible backend.

Available Metrics

Daytona sandboxes expose the following resource metrics:

CPU Metrics

Memory Metrics

Disk Metrics

Labels

All metrics include the service_name label identifying the sandbox.

Quick Start

1. Configure OTLP Export

Enable OpenTelemetry metric export in your Daytona dashboard:
  1. Go to Daytona Dashboard
  2. Navigate to SettingsExperimental
  3. Configure OTLP settings:
    • OTLP Endpoint: Your collector endpoint (e.g., https://otlp-gateway-prod-eu-central-0.grafana.net/otlp)
    • OTLP Headers: Authorization header (e.g., Authorization=Basic <token>)
  4. Click Save

2. Verify Metrics Flow

Create a sandbox and verify metrics are being exported:
Verify in your observability platform that metrics are appearing with the prefix daytona_sandbox_*.

Integration Guides

Grafana Cloud

Step 1: Create Grafana Cloud Account
  1. Go to grafana.com and create a free account
  2. Create a new stack (choose a region close to you)
Step 2: Set Up OpenTelemetry Connection
  1. In Grafana Cloud Portal, go to ConnectionsAdd new connection
  2. Search for OpenTelemetry (OTLP) and select it
  3. Follow setup wizard:
    • Choose OpenTelemetry SDK
    • Choose Linux infrastructure
  4. Create a Grafana Cloud Access token:
    • Name: daytona-otel-token
    • Scopes: All scopes
    • Save the token securely
  5. Note your configuration values:
    • OTEL_EXPORTER_OTLP_ENDPOINT (e.g., https://otlp-gateway-prod-eu-central-0.grafana.net/otlp)
    • OTEL_EXPORTER_OTLP_HEADERS (e.g., Authorization=Basic MTUxNzAz...)
Step 3: Configure Daytona Enter the values in Daytona Dashboard SettingsExperimental:
  • OTLP Endpoint: The endpoint URL from Grafana
  • OTLP Headers: The Authorization header from Grafana
Step 4: Import Dashboard
  1. Download the Grafana dashboard template
  2. In Grafana Cloud, click DashboardsNewImport
  3. Upload dashboard.json
  4. Select your Prometheus data source
  5. Click Import
Dashboard Features:
  • Resource Overview: High-level metrics across all sandboxes
  • CPU Details: Detailed CPU utilization, limits, and heatmaps
  • Memory Details: Memory usage patterns and limits
  • Disk Details: Filesystem usage and space breakdown
  • Alert Thresholds: Pre-configured warning and critical levels
Reference: Grafana Dashboard Example

Prometheus + Grafana (Self-Hosted)

Step 1: Deploy OpenTelemetry Collector
Step 2: Configure Prometheus
Step 3: Set Up Grafana
  1. Add Prometheus data source in Grafana
  2. Import the Daytona dashboard template
  3. Start monitoring sandbox metrics

New Relic

  1. Get your New Relic OTLP endpoint and API key
  2. Configure in Daytona Dashboard:
    • Endpoint: https://otlp.nr-data.net:4318
    • Headers: api-key=<YOUR_NEW_RELIC_LICENSE_KEY>
  3. View metrics in New Relic under Metrics & Events
Reference: New Relic Dashboard Example

Query Examples

PromQL Queries

CPU Utilization Over Time:
High Memory Usage Alerts:
Disk Space Remaining:
Resource Pressure Score:
Top CPU Consumers:

Alert Rules

Programmatic Monitoring

Query Metrics via API

Custom Metrics Collection

Best Practices

Alert Thresholds

Recommended warning and critical levels:

Retention Policies

High Cardinality

For environments with many sandboxes:
  • Use longer aggregation intervals
  • Filter to specific service names
  • Reduce retention period
  • Consider downsampling old data

Monitoring Multi-Agent Systems

Troubleshooting

No Metrics Appearing

  1. Verify OTLP configuration in Daytona Dashboard
  2. Create test sandbox and run workload
  3. Check endpoint connectivity:
  4. Verify time range in your observability platform

High Cardinality Warnings

If too high, consider:
  • Filtering to active sandboxes only
  • Using recording rules
  • Increasing aggregation intervals

Missing Labels

Ensure metric names and label names match exactly (underscores, not dots).