Skip to main content

Metrics

The metrics commands allow you to monitor resource usage and performance metrics for your ODIN Fleet applications and servers. You can track CPU usage, memory consumption, disk I/O, network traffic, and instance counts over time.

Overview​

Metrics are available at two levels:

  • App-Level Metrics: Monitor aggregate resource usage across your entire application, including CPU usage, running instances, and peak instance counts.
  • Server-Level Metrics: Monitor individual server performance including CPU, memory, disk I/O, and network traffic.

All metrics commands support JSON output for programmatic usage and display human-readable tables by default with automatic unit conversion (bytes to MB, CPU as percentage).

Usage​

odin fleet metrics <command>

Commands​

  • App: Monitor app-level metrics (CPU usage, instances).
  • Server: Monitor server-level metrics (CPU, memory, disk, network).

Working with Timestamps​

Metrics commands that query data over time require Unix timestamps for the --start and --end parameters. Here's how to calculate timestamps for common time ranges:

# Last 7 days
START=$(date -v-7d +%s)
END=$(date +%s)

# Last 24 hours
START=$(date -v-24H +%s)
END=$(date +%s)

# Last 30 days
START=$(date -v-30d +%s)
END=$(date +%s)

On Linux systems, use this syntax instead:

# Last 7 days (Linux)
START=$(date -d '7 days ago' +%s)
END=$(date +%s)