> ## Documentation Index
> Fetch the complete documentation index at: https://docs.squasher.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Infrastructure monitoring

> Set up host and Docker resource metrics with a reviewable Squasher CLI workflow.

Squasher Collector is the small service that sends infrastructure metrics to
Squasher. It is a purpose-built Rust service that sends OpenTelemetry data. The Linux setup collects CPU, memory, disk,
filesystem, load, network, paging, system uptime, process counts, and Collector
health. Docker container resource metrics are optional. It does not collect
process command lines, environment variables, application logs, or eBPF data.

You can use `squasher infra` as the short form of `squasher infrastructure`.

## Fast path

The complete setup is one preview, one reviewed install, and one data check:

```bash theme={null}
squasher infra plan --project <project_id> --service-name payments-host
squasher infra render --project <project_id> --service-name payments-host --output ./squasher-infra
SQUASHER_API_KEY=<project_api_key> sudo --preserve-env=SQUASHER_API_KEY ./squasher-infra/install.sh
sudo squasher infra doctor
squasher infra verify --project <project_id> --service-name payments-host
```

Add `--containers` to `plan`, `render`, and `verify` when you need Docker
metrics. The install bundle contains no API key. The root install process writes
the key to a mode `0600` environment file and does not print it.

## Preview the setup

Preview does not write files or change the host:

```bash theme={null}
squasher infra plan \
  --project <project_id> \
  --service-name payments-host \
  --environment production \
  --containers
```

Coding agents can use strict JSON input and inspect the current schema:

```bash theme={null}
squasher infra schema render --pretty
squasher infra plan --input '{
  "project": "<project_id>",
  "service_name": "payments-host",
  "environment": "production",
  "containers": true,
  "interval_seconds": 60
}'
```

Unknown fields and unsafe identity values are rejected before any write.

## Render and review

```bash theme={null}
squasher infra render \
  --project <project_id> \
  --service-name payments-host \
  --containers \
  --output ./squasher-infra
```

The new directory contains:

* `manifest.json` with file hashes, modes, and collector identity
* `config.yaml` with host and optional Docker receivers
* `install.sh` with pinned static amd64 and arm64 binaries and checksums
* `README.md` with install and verification commands

The rendered bundle contains no API key. The command refuses to overwrite an
existing directory.

## Install

Review the files, then pass the project API key only to the root install
process:

```bash theme={null}
export SQUASHER_API_KEY=<project_api_key>
sudo --preserve-env=SQUASHER_API_KEY ./squasher-infra/install.sh
unset SQUASHER_API_KEY
```

The installer supports Debian, Ubuntu, and RPM-based Linux on amd64 and arm64.
It installs the static Rust Squasher Collector as a systemd service. The default
service limits are 64 MiB of memory and 10% of one CPU. Docker mode requires
`/var/run/docker.sock` and adds the collector user to the Docker group.

These values are safety ceilings, not reserved resources. `MemoryHigh=32M`
asks the system to reclaim memory before use reaches the hard `MemoryMax=64M`
stop. `CPUQuota=10%` limits sustained use to one tenth of one CPU. The normal
host-only process is expected to stay well below these ceilings. The limits do
not add a separate infrastructure charge.

## Verify real data

After one collection interval, verify the expected series through the Squasher
API:

```bash theme={null}
squasher infra verify \
  --project <project_id> \
  --service-name payments-host \
  --containers
```

The JSON result is `healthy` or `incomplete`. It checks CPU, memory, filesystem,
optional Docker metrics, and fresh Collector self-health. This proves that the
service is active and that Squasher can read the data after ingestion. An
incomplete result includes the exact missing signal and local recovery commands.

## Check and remove the Collector

```bash theme={null}
squasher infra status
sudo squasher infra doctor
squasher infra collectors list --project <project_id>
squasher infra collectors overview --project <project_id>
sudo squasher infra uninstall --yes
```

`status` reports the local process state, memory, and CPU time. `doctor` checks
the service, Rust engine, configuration, secret permissions, resource ceilings,
dedicated user, and Docker socket access. Run it with `sudo` so it can validate
the protected configuration without showing the secret. `verify` is the remote
end-to-end data check. Uninstall only removes a service that has the Squasher
managed marker. It also removes the dedicated Rust collector binary.

| Check                   | What it proves                                                            |
| ----------------------- | ------------------------------------------------------------------------- |
| `infra plan`            | Exact signals, privileges, limits, and files before a write               |
| `infra render`          | A secret-free, hashed, reviewable install bundle                          |
| `infra status`          | Local systemd process and current resource use                            |
| `infra doctor`          | Local Rust engine, configuration, permissions, and optional Docker access |
| `infra verify`          | Fresh host, optional Docker, and Collector health data in Squasher        |
| `infra collectors list` | Per-Collector version, identity, resource use, and pipeline counters      |
| `infra uninstall --yes` | Safe removal of only the Squasher-managed service                         |

## eBPF and application signals

The Collector does not use eBPF. eBPF agents can create application traces and
network telemetry without code changes, but they need kernel support and extra
Linux capabilities. That is a different scope from low-overhead host and Docker
resource collection. Use a Squasher SDK or an OpenTelemetry integration for
application logs and traces. The default infrastructure install stays
unprivileged when Docker mode is off.

## Kubernetes

Use the [Kubernetes integration](/integrations/kubernetes) for a DaemonSet,
Kubernetes metadata, pod logs, and kubelet metrics. The infrastructure CLI
currently renders the Linux systemd target only.

## Agent handoff

```text theme={null}
Set up Squasher infrastructure monitoring for project <project_id>. First run
`squasher infra schema render`, then preview with `infra plan`. Render to a new
directory and inspect manifest.json. Ask before running
the root install script. Never put the API key in the bundle or command output.
After installation, run `sudo squasher infra doctor` and `infra verify`. Report exact missing
series.
```
