Questions it answers
Filetrace links files, processes and network endpoints in both directions, so you can start an investigation from whichever side you know.How it works
Filetrace is two programs.filetrace-agent loads BPF programs into the kernel, keeps what they report in bounded memory, and answers queries on a local socket. filetrace is the command-line interface: it asks the agent and prints the answer as a table, JSON, JSON Lines or CSV.
The agent attributes a send to a file in two ways. When the kernel moves a file to a socket itself, as sendfile(2) does, the attribution is EXACT. When a thread reads a regular file and then sends on a socket, the attribution is INFERRED, because the payload cannot be proven to come only from that file. Bytes that no file accounts for are still counted, as UNKNOWN.
The same state is available to other tools: a Prometheus metrics page, OpenTelemetry events and metrics over OTLP, and a gRPC API that lists and streams transfers.
Requirements
Collection needs Linux 6.1 or later with BTF. Filetrace is tested on Linux 6.1, 6.12 and 7.0 on arm64, and continuous integration builds and tests x86-64 and arm64. On macOS the command-line interface builds and reports diagnostics, but nothing is collected.Next steps
Quickstart
Install Filetrace, start the agent and find your first file transfer.
Installation
Package repositories, Homebrew, release archives, versions and channels.
File attribution
How a send is tied to a file, and what EXACT and INFERRED mean.
CLI reference
Every command, option, filter and output format.
Integrations
Prometheus metrics, OpenTelemetry export and the gRPC API.
Configuration
Every setting of the agent’s configuration file.