Flight recorder
Example on GitHub: flightrec
The flight recorder is an event collection tool that gathers various information about a working Tarantool instance, such as:
- logs
- metrics
- requests and responses
This information helps you investigate incidents related to crashing a Tarantool instance.
The flight recorder is disabled by default and can be enabled and
configured for a specific Tarantool instance. To enable the flight
recorder, set the
flightrec.enabled
configuration option to true.
flightrec:enabled: true
After flightrec.enabled is set to true, the flight recorder starts
collecting data in the flight recording file current.ttfr. This file
is stored in the snapshot.dir
directory. By default, the directory is
var/lib/{{ instance_name }}/<file_name>.ttfr.
If the instance crashes and reboots, Tarantool rotates the flight
recording: current.ttfr is renamed to <timestamp>.ttfr (for example,
20230411T050721.ttfr) and the new current.ttfr file is created for
collecting data. In the case of correct shutdown (for example, using
os.exit()), Tarantool continues writing to the existing current.ttfr
file after restart.
When the flight recorder is enabled, you can set the options related to logging, metrics, and storing the request and response data.
The flightrec configuration might look as follows:
flightrec:enabled: truelogs_size: 10485800logs_log_level: 5metrics_period: 240metrics_interval: 0.5requests_size: 10485780
In the example, the following options are set:
- flightrec.logs_size – a log storage size in bytes.
- flightrec.logs_log_level – a log_level.
- flightrec.metrics_period – the number of seconds to store metrics after the dump.
- flightrec.metrics_interval – the frequency of metrics dumps in seconds.
- flightrec.requests_size – a storage size for the request and response data in bytes.
Read more: Flight recorder configuration options.