[otlp] settings, the endpoint forms, a collector configuration that receives the data, the format of the log records, and how the exporter batches, retries and buffers when the collector cannot be reached.
Turn on the exporter
1
Run a collector on the same host
The exporter speaks OTLP over gRPC without TLS, so it sends to an OpenTelemetry Collector or Grafana Alloy on the same machine, which forwards to Loki, Elasticsearch, Splunk, Datadog or a SIEM with credentials and encryption of its own. See Collector configuration.
2
Enable the exporter
Add the
[otlp] section to /etc/filetrace/config.toml:3
Restart the agent
exporting events and metrics to 127.0.0.1:4317 over OTLP/gRPC.Settings
Every key of the[otlp] section, with its default:
boolean
default:"false"
Turns the exporter on. With
logs and metrics both false, the exporter does not start.string
default:"127.0.0.1:4317"
Where the collector receives OTLP over gRPC: a numeric address and port, or
unix: followed by the path of a Unix socket. See Endpoint forms.boolean
default:"true"
Sends the events of the types in
events as log records.boolean
default:"true"
Sends the metrics every
metrics_interval.list of strings
default:"[\"file_transfer\", \"event_loss\"]"
The event types that leave as log records. Any type that
filetrace events knows: process_exec, process_fork, process_exit, socket_connect, socket_listen, socket_established, socket_close, file_seen, network_send, network_receive, file_transfer and event_loss. A name that is not an event type is a configuration error.boolean
default:"true"
With
false, log records leave out file paths. A file is then described by its device and inode, which remain.integer
default:"1024"
The most log records in one export request, from 16 to 4096.
duration
default:"5s"
How often the log records collected so far are sent, from
"100ms" to "1h".duration
default:"30s"
How often the metrics are sent, from
"1s" to "1h".duration
default:"10s"
How long one export request may take, from
"1s" to "5m". A request that takes longer counts as failed and is retried.ms, s, m, h or d. The configuration reference describes the rest of the file.
Endpoint forms
localhost stands for 127.0.0.1; no other host name is resolved. The agent checks the endpoint when it starts, and an endpoint in none of these forms is a configuration error (exit code 6). A collector that is not running yet is not an error: the exporter keeps trying, as described under Delivery and retries.
Collector configuration
A minimal OpenTelemetry Collector configuration that receives both signals and prints them:debug exporter with the exporter your backend documents. A sketch that forwards both signals over OTLP/HTTP with TLS and a bearer token taken from the collector’s environment:
endpoint at the address its OTLP gRPC receiver listens on.
If a collector turns the metrics into Prometheus metrics, their names and labels are those of the Prometheus page, so the same PromQL works either way.
Log records
Events of the types listed inevents leave as log records, one per event except where batching sums the bytes of several:
Every request carries the resource attributes
service.name (filetrace), service.version, host.name and os.type, and the instrumentation scope filetrace with the agent’s version.
A transfer as a collector’s debug exporter prints it:
filetrace.transfer.bytes_read, and one still below the reporting thresholds has no filetrace.transfer.confidence. A deleted file adds filetrace.file.deleted.
Attributes by event type
An attribute whose value is not known is left out. The metrics and attributes reference gives the type and meaning of each attribute, and event types describes the events.
Batching and aggregation
Log records are sent everyflush_interval. Bytes of one transfer, or of one socket and peer, that arrive within an interval are summed into a single record, which keeps the time and confidence of the latest part. A long transfer therefore produces one record per interval, and the bytes of its records add up to the transfer.
A batch also leaves before the interval ends when it holds batch_size records, or when its request approaches 3 MB, which keeps each request under the 4 MB that a collector accepts by default.
Byte counts are what the local socket accepted, not bytes on the wire. A network or transfer event carries the bytes of one collection interval of the agent, not of one system call; see records and identifiers.
Metrics
Metrics are sent everymetrics_interval, cumulative since the agent started: every counter point carries the agent’s start time as its start timestamp. Counters are monotonic sums with cumulative temporality; the other metrics are gauges. The metrics, their units and attributes are those listed in the metrics and attributes reference.
Delivery and retries
The exporter has one request of each signal in flight at a time.- Log records. When the collector cannot be reached, or answers with a status worth retrying (
UNAVAILABLE,DEADLINE_EXCEEDED,RESOURCE_EXHAUSTED,ABORTED,CANCELLED,OUT_OF_RANGEorDATA_LOSS), the agent keeps the request and tries again after a pause that grows from one second to thirty. Meanwhile up to 16 batches, at most 8 MB together, wait behind it. Beyond that the oldest waiting batch is given up, and the agent’s log reportsgave up exportingwith the number of records, at most once a minute. - Rejected batches. A batch that the collector refuses with any other status is given up, and the agent logs the status and the collector’s message. When the collector accepts a request but rejects some records, the agent logs how many and why.
- Metrics. A metrics request that fails is not sent again. The next collection,
metrics_intervallater, carries the cumulative values and makes up for it.
cannot export to when the collector becomes unreachable and exporting to ... again when it answers again.
When the agent stops, it sends the batch it is filling and a last collection of metrics, and gives them up to one second to leave, unless the collector is already known to be unreachable. Batches waiting for a collector live in memory and do not survive a restart.
File paths and text encoding
file_paths = false leaves file paths out of the log records. Device and inode remain, so records about the same file can still be told apart.
A path or process name that is not valid UTF-8 is sent with ? in place of the offending bytes.