Skip to main content
This page turns the Prometheus and OTLP exporters into working observability: alert rules you can paste into Prometheus, panels for a Grafana dashboard, a collector that routes logs and metrics to different backends, and queries that join Filetrace with the rest of your telemetry. The examples assume the agent serves metrics on 127.0.0.1:9464 and exports OTLP to a collector on 127.0.0.1:4317.

What Filetrace adds to your telemetry

Application telemetry tells you that a request was served. Filetrace tells you which file left the machine, by which process, to which address, and how sure that association is. The two join on the host and the process: Metrics deliberately carry no file path or address, so their series stay bounded. When you need the path or the destination, use a log record or the API.

Prometheus alert rules

Save this as filetrace.rules.yml and point rule_files at it. Every expression uses only the metrics and labels on the Prometheus page.
FiletraceUnattributedEgress is informational, not a fault. A server that generates responses in memory, a proxy that streams from another socket, or a database that sends query results all produce egress with no file behind it. Use it to find the processes worth investigating, not to page someone.

Grafana dashboard

A compact dashboard with five panels. Each query is self-contained; paste it into a Grafana panel with the Prometheus data source that scrapes Filetrace. Outbound bytes per second, by process
File bytes versus unattributed egress
Transfers in progress, by confidence
Transfers started per minute, by method
Lost events, by kind
Agent resource use
process_cpu_time_seconds_total and process_memory_usage_bytes are common names. Select the agent’s series with job="filetrace" so they do not mix with other exporters.

OpenTelemetry Collector

The agent sends OTLP/gRPC without TLS to a collector on the same host. The collector adds credentials, batching and routing, and forwards each signal to the backend that fits it: metrics to Prometheus remote write, log records to Loki, and both to a SIEM.
Point the agent at the collector:
file_paths = true (the default) sends full paths to the collector. Set file_paths = false when the backend must not store them; records then carry the device and inode instead. command_line = false (the default) keeps process arguments, which can hold secrets, on the host.

Joining Filetrace with application telemetry

Filetrace does not emit traces. It emits log records and metrics that share identifiers with the rest of your telemetry, so you can pivot from an application signal to the file that left the machine. From a slow request to the file it sent. In your tracing UI, find the span for the request and note its host and PID. In Loki, query the transfer records for that process in the same window:
From a destination to every file sent to it. When an address looks wrong, list what went there:
From a file to every process that read it. When a sensitive file is involved, find every sender:
The same questions are one command away on the host:

Correlating with traces through exemplars

Filetrace metrics are counters and gauges without exemplars, so a Grafana panel cannot jump straight to a trace. Two patterns work well:
  1. Log-based pivot. Keep file_transfer log records in Loki and add a Grafana derived field on process_pid that links to your tracing UI filtered by that PID and the record’s time range.
  2. Dashboard variable. Add a process_executable_name variable to the dashboard and filter both the Filetrace panels and the application panels by it. The process name is the common key.

Sizing and retention

  • Metrics are cheap: a fixed set of series plus one per process, method and confidence, bounded by [limits] metric_series (default 2048). Scrape every 15–30 seconds.
  • Log records are the volume. file_transfer records are emitted per transfer, not per byte, but a busy web server can produce thousands per minute. Batch in the collector and set a retention that matches your audit needs.
  • The agent’s own history is in memory and starts when the agent starts. For questions older than a restart, use the metrics and log records you exported, not filetrace files.
See overhead and sizing for the queue and table settings, and metrics and attributes for every name.