Skip to content

Exporting metrics

Daemonitor can export normalized process metrics, lifecycle events, and host snapshots for offline analysis, CI artifacts, or ingestion into external tools.

Normalized metric stream (metrics)

Query normalized metric records from retained process history:

daemonitor-cli metrics --since 30m --format jsonl

Each history sample expands into normalized MetricRecord rows (schema_version: 1) covering OS and JVM measurements. You can filter with --pid, --ecosystem, --project, --since (default 15m, max 168h), and --limit (default 500, max 5000).

To inspect which metrics are available on the current host and OS before exporting:

daemonitor-cli metrics list

Full JSONL bundle (export)

Write a combined JSONL file containing normalized metric records, process lifecycle events (/v1/events), and the current host record (kind: "host"):

daemonitor-cli export --since 1h --output build-telemetry.jsonl
  • --output is required (exits with status 2 if omitted).
  • The output file is created with restrictive 0600 permissions.
  • Supports --since, --limit, --pid, --ecosystem, and --project.

Interpreting missing values

In JSON, JSONL, and CSV exports, unavailable metrics are emitted as null (or empty/— in plain text).

Missing values are not zero

A null value for heap_used_mb, physical_footprint_bytes, or disk_read_bytes means the metric was unavailable, unsupported on that platform, or not yet sampled (for example, cpu_percent on a process's first poll). Never treat null as 0.

Example: CI artifact export

# Run your build under observation and export the last 30m of telemetry
daemonitor-cli observe --output session-summary.json -- ./gradlew assembleDebug
daemonitor-cli export --since 30m --ecosystem gradle --output daemonitor-export.jsonl