Skip to main content

App Metrics

Monitor aggregate resource usage and instance counts across your entire application. These metrics provide an overview of your app's resource consumption and scaling behavior.

Overview​

App-level metrics allow you to track:

  • CPU Usage: Monitor CPU consumption across all instances
  • Instance Counts: Track running instances and peak usage

Usage​

odin fleet metrics app <command>

Commands​

CPU Metrics​

cpu-instant​

Get the current CPU usage for your app as an instant snapshot.

odin fleet metrics app cpu-instant

cpu-usage​

Get CPU usage over a specified time range.

odin fleet metrics app cpu-usage --start <TIMESTAMP> --end <TIMESTAMP>

Flags:

  • --start=<number>: Unix timestamp for the start of the time range (required).
  • --end=<number>: Unix timestamp for the end of the time range (required).

cpu-usage-per-day​

Get daily aggregated CPU usage over a specified time range.

odin fleet metrics app cpu-usage-per-day --start <TIMESTAMP> --end <TIMESTAMP>

Flags:

  • --start=<number>: Unix timestamp for the start of the time range (required).
  • --end=<number>: Unix timestamp for the end of the time range (required).

Instance Metrics​

instances-instant​

Get the current number of running instances.

odin fleet metrics app instances-instant

instances-running​

Get the number of running instances over a specified time range.

odin fleet metrics app instances-running --start <TIMESTAMP> --end <TIMESTAMP>

Flags:

  • --start=<number>: Unix timestamp for the start of the time range (required).
  • --end=<number>: Unix timestamp for the end of the time range (required).

instances-peak​

Get the peak instance count.

odin fleet metrics app instances-peak

Examples​

Get current CPU usage:

odin fleet metrics app cpu-instant

Get CPU usage for the last 7 days:

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

odin fleet metrics app cpu-usage --start $START --end $END

Get daily CPU usage breakdown:

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

odin fleet metrics app cpu-usage-per-day --start $START --end $END

Get metrics as JSON for programmatic usage:

odin fleet metrics app cpu-instant --format json

Global Flags​

The following flags can be used with any ODIN CLI command:

  • --api-key=<string> The API key to use for authentication. If omitted, the CLI will use the api-key stored in the configuration file on your system. Use odin login to store the API key for subsequent commands.

  • --app-id=<string> The ID of the app to use for the command. If omitted, the CLI will use the currently selected app. Use odin apps select to select an app interactively.

  • --format=<string> The output format to use for the command. Supported formats are json, value, flattened and table. If omitted, the CLI will use the default format specified in the configuration file. Learn more about output formatting.

  • --force Forces the command to execute without prompting for confirmation. Use with caution.

  • --quiet Suppresses all informational output except for errors. Useful for scripting and automation.