Monitoring & Logs

niso integrates with journald for logs, cgroups for metrics, and systemd timers for health checks. No sidecar containers needed.

Logs#

All service output goes to the systemd journal. View logs with niso logs or directly with journalctl.

bash
# Follow logs in real time$ niso logs my-api --follow# Show last 100 lines$ niso logs my-api --tail 100# Logs since a duration$ niso logs my-api --since 1h# JSON output$ niso logs my-api --format json# Equivalent journalctl command$ journalctl -u niso-my-api -f

Service status#

bash
# Status of a specific service$ niso status my-api  my-api  1.2.0  active (running)  uptime 5d  mem 45 MB# Status of all services$ niso status  NAME       VERSION  STATUS   UPTIME   MEMORY   CPU  my-api     1.2.0    active   5d       45 MB    2.1%  postgres   16.0.0   active   12d      120 MB   0.5%  redis      7.2.0    active   12d      8 MB     0.1%# JSON output for scripting$ niso status --format json

Resource monitoring#

niso reads cgroup stats directly from the kernel — no metrics agent or exporter required.

bash
# Live resource usage (top-like)$ niso top  NAME       CPU     MEM      MEM%   NET I/O     DISK I/O   PIDS  my-api     2.1%    45 MB    8.8%   12 KB/s     0 B/s      14  postgres   0.5%    120 MB   23.4%  4 KB/s      2 KB/s     8  redis      0.1%    8 MB     1.6%   1 KB/s      0 B/s      4# Resource stats for a single service$ niso stats my-api  CPU:     2.1% (limit: 200%)  Memory:  45 MB / 512 MB (8.8%)  PIDs:    14 / 4096  I/O:     read 1.2 MB, written 0.5 MB

Health checks#

Health checks run as systemd timers alongside your service. Configure them in manifest.toml:

toml
[healthcheck]http = "http://127.0.0.1:8080/health"interval = "30s"timeout = "5s"retries = 3start_period = "10s"
bash
# View health status$ niso health my-api  Status:   healthy  Checks:   142 passed, 0 failed  Last:     2026-04-12T10:30:00Z (200 OK, 3ms)# Health check history$ niso health history my-api  TIME                    STATUS    LATENCY  2026-04-12T10:30:00Z    healthy   3ms  2026-04-12T10:29:30Z    healthy   2ms  2026-04-12T10:29:00Z    healthy   4ms

Events#

Stream lifecycle events for all services via the systemd journal:

bash
# Stream events$ niso events --follow  2026-04-12T10:30  my-api     activated   1.2.0  2026-04-12T10:28  my-api     stopped     1.1.0  2026-04-12T10:25  postgres   healthy# Filter by service or event type$ niso events --filter service=my-api$ niso events --filter action=activated

TUI dashboard#

A full-screen terminal dashboard showing all services, their status, resource usage, and recent logs — built with ratatui:

bash
$ niso dashboard

Audit log#

Every administrative action is logged to an append-only JSON lines audit log:

bash
$ niso audit  TIME                    USER    ACTION      TARGET        DETAIL  2026-04-12T10:30:00Z    root    activate    my-api        1.2.0  2026-04-12T10:25:00Z    root    install     my-api        1.2.0  2026-04-12T08:00:00Z    root    snapshot    app-data# Filter by service or action$ niso audit --service my-api$ niso audit --action activate --since 7d

Debug#

bash
# Full debug info for a service$ niso debug my-api  Package:    my-api 1.2.0  Unit:       niso-my-api.service  PID:        12345  Isolation:  server (DynamicUser, seccomp, zero caps)  Network:    backend (10.99.1.2)  Ports:      8080→8080  Volumes:    data → /var/lib/niso/volumes/my-api-data  Memory:     45 MB / 512 MB  Uptime:     5d 2h 30m# Execute a command inside the service environment$ niso exec my-api -- env$ niso exec my-api -- ls /data

System info#

bash
$ niso info  Version:      0.9.0  Platform:     linux/x86_64  systemd:      254  cgroups:      v2  Kernel:       6.1.0  State DB:     /opt/niso/state/niso.db  Packages:     5 installed, 3 active  Disk usage:   245 MB (packages), 1.4 GB (volumes)$ niso df  TYPE        USED      COUNT  Packages    245 MB    8 versions  Volumes     1.4 GB    3 volumes  Runtimes    180 MB    2 runtimes  Total       1.8 GB