Skip to content

Commit da188b2

Browse files
committed
Update flightrec topic
* Add flightrec reference section (YAML) * Update Flight Recorder page
1 parent 4cd1251 commit da188b2

File tree

5 files changed

+220
-176
lines changed

5 files changed

+220
-176
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
groups:
2+
group001:
3+
replicasets:
4+
replicaset001:
5+
instances:
6+
instance001:
7+
iproto:
8+
listen:
9+
- uri: '127.0.0.1:3301'
10+
flightrec:
11+
enabled: true
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
instance001:

doc/enterprise/flight_recorder.rst

Lines changed: 20 additions & 175 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,40 @@
33
Flight recorder
44
===============
55

6+
**Example on GitHub**: `flightrec <https://github.com/tarantool/doc/tree/latest/doc/code_snippets/snippets/config/instances.enabled/flightrec>`_
7+
68
The flight recorder available in the Enterprise Edition is an event collection tool that
79
gathers various information about a working Tarantool instance, such as:
810

911
* logs
10-
1112
* metrics
12-
1313
* requests and responses
1414

1515
This information helps you investigate incidents related
1616
to :ref:`crashing <admin-disaster_recovery>` a Tarantool instance.
1717

1818

19-
.. _enable:
19+
.. _enterprise-flight-recorder_enable:
2020

2121
Enabling the flight recorder
2222
----------------------------
2323

2424
The flight recorder is disabled by default and can be enabled and configured for
2525
a specific Tarantool instance.
26-
To enable the flight recorder, set the ``flightrec_enabled``
27-
:doc:`configuration option </reference/configuration/index>` to ``true``.
28-
This option is :ref:`dynamic <box_cfg_params>` and can be changed at runtime by calling ``box.cfg{}``:
26+
To enable the flight recorder, set the :ref:`flightrec.enabled <configuration_reference_flightrec_enabled>`
27+
configuration option to ``true``. This option is dynamic and can be changed at runtime.
2928

30-
.. code-block:: lua
29+
.. literalinclude:: /code_snippets/snippets/replication/instances.enabled/flightrec/config.yaml
30+
:language: yaml
31+
:start-at: flightrec:
32+
:end-at: enabled: true
33+
:dedent:
3134

32-
box.cfg{ flightrec_enabled = true }
3335

3436
After ``flightrec_enabled`` is set to ``true``, the flight recorder starts collecting data in the flight recording file ``current.ttfr``.
3537
This file is stored in the :ref:`memtx_dir <cfg_basic-memtx_dir>` directory.
38+
By default, the directory is ``var/log/{{ instance_name }}/<file_name>.ttfr``.
39+
3640
If the instance crashes and reboots, Tarantool rotates the flight recording:
3741
``current.ttfr`` is renamed to ``<timestamp>.ttfr`` (for example, ``20230411T050721.ttfr``)
3842
and the new ``current.ttfr`` file is created for collecting data.
@@ -44,175 +48,16 @@ Tarantool continues writing to the existing ``current.ttfr`` file after restart.
4448
Note that old flight recordings should be removed manually.
4549

4650

51+
See also: :ref:`Flight recorder configuration options <configuration_reference_flightrec>`.
4752

48-
.. _config:
49-
50-
Configuration
51-
-------------
52-
53-
This section describes options related to the flight recorder configuration.
54-
Note that all options are :ref:`dynamic <box_cfg_params>` and can be changed at runtime.
55-
56-
.. TODO not implemented yet
57-
.. _config-directory:
58-
59-
Flight recording directory
60-
~~~~~~~~~~~~~~~~~~~~~~~~~~
61-
62-
.. _cfg_flightrec_dir:
63-
64-
.. confval:: flightrec_dir
65-
66-
Specifies the directory used to store flight recordings (``*.ttfr`` files).
67-
68-
| Type: string
69-
| Default: :ref:`memtx_dir <cfg_basic-memtx_dir>`
70-
| Environment variable: TT_FLIGHTREC_DIR
71-
72-
73-
74-
.. _config-logs:
75-
76-
Logs
77-
~~~~
78-
79-
This section describes the flight recorder settings related to :ref:`logging <cfg_logging-log>`.
80-
For example, you can configure a more detailed logging level in the flight recorder for deeper analysis.
81-
82-
* :ref:`flightrec_logs_size <cfg_flightrec_logs_size>`
83-
* :ref:`flightrec_logs_max_msg_size <cfg_flightrec_logs_max_msg_size>`
84-
* :ref:`flightrec_logs_log_level <cfg_flightrec_logs_log_level>`
85-
86-
.. _cfg_flightrec_logs_size:
87-
88-
.. confval:: flightrec_logs_size
89-
90-
Specifies the size (in bytes) of the log storage.
91-
You can set this option to ``0`` to disable the log storage.
92-
93-
| Type: integer
94-
| Default: 10485760
95-
| Environment variable: TT_FLIGHTREC_LOGS_SIZE
96-
97-
98-
.. _cfg_flightrec_logs_max_msg_size:
99-
100-
.. confval:: flightrec_logs_max_msg_size
101-
102-
Specifies the maximum size (in bytes) of the log message.
103-
The log message is truncated if its size exceeds this limit.
104-
105-
| Type: integer
106-
| Default: 4096
107-
| Maximum: 16384
108-
| Environment variable: TT_FLIGHTREC_LOGS_MAX_MSG_SIZE
109-
110-
111-
.. _cfg_flightrec_logs_log_level:
112-
113-
.. confval:: flightrec_logs_log_level
114-
115-
Specifies the level of detail the log has.
116-
You can learn more about log levels from the :ref:`log_level <cfg_logging-log_level>`
117-
option description.
118-
Note that the ``flightrec_logs_log_level`` value might differ from ``log_level``.
119-
120-
| Type: integer
121-
| Default: 6
122-
| Environment variable: TT_FLIGHTREC_LOGS_LOG_LEVEL
123-
124-
125-
.. _config-metrics:
126-
127-
Metrics
128-
~~~~~~~
129-
130-
This section describes the flight recorder settings related to collecting
131-
:ref:`metrics <metrics-reference>`.
132-
133-
* :ref:`flightrec_metrics_period <cfg_flightrec_metrics_period>`
134-
* :ref:`flightrec_metrics_interval <cfg_flightrec_metrics_interval>`
135-
136-
.. _cfg_flightrec_metrics_period:
137-
138-
.. confval:: flightrec_metrics_period
139-
140-
Specifies the time period (in seconds) that defines how long metrics are stored from the moment of dump.
141-
So, this value defines how much historical metrics data is collected up to the moment of crash.
142-
The frequency of metric dumps is defined by :ref:`flightrec_metrics_interval <cfg_flightrec_metrics_interval>`.
143-
144-
| Type: integer
145-
| Default: 180
146-
| Environment variable: TT_FLIGHTREC_METRICS_PERIOD
147-
148-
149-
.. _cfg_flightrec_metrics_interval:
150-
151-
.. confval:: flightrec_metrics_interval
152-
153-
Specifies the time interval (in seconds) that defines the frequency of dumping metrics.
154-
This value shouldn't exceed :ref:`flightrec_metrics_period <cfg_flightrec_metrics_period>`.
155-
156-
| Type: number
157-
| Default: 1.0
158-
| Minimum: 0.001
159-
| Environment variable: TT_FLIGHTREC_METRICS_INTERVAL
160-
161-
.. NOTE::
162-
163-
Given that the average size of a metrics entry is 2 kB,
164-
you can estimate the size of the metrics storage as follows:
165-
166-
.. code-block:: console
167-
168-
(flightrec_metrics_period / flightrec_metrics_interval) * 2 kB
169-
170-
171-
172-
.. _config-requests:
173-
174-
Requests
175-
~~~~~~~~
176-
177-
This section lists the flight recorder settings related to
178-
storing the :ref:`request and response <internals-requests_responses>` data.
179-
180-
* :ref:`flightrec_requests_size <cfg_flightrec_requests_size>`
181-
* :ref:`flightrec_requests_max_req_size <cfg_flightrec_requests_max_req_size>`
182-
* :ref:`flightrec_requests_max_res_size <cfg_flightrec_requests_max_res_size>`
183-
184-
.. _cfg_flightrec_requests_size:
185-
186-
.. confval:: flightrec_requests_size
187-
188-
Specifies the size (in bytes) of storage for the request and response data.
189-
You can set this parameter to ``0`` to disable a storage of requests and responses.
190-
191-
| Type: integer
192-
| Default: 10485760
193-
| Environment variable: TT_FLIGHTREC_REQUESTS_SIZE
194-
195-
196-
197-
.. _cfg_flightrec_requests_max_req_size:
198-
199-
.. confval:: flightrec_requests_max_req_size
200-
201-
Specifies the maximum size (in bytes) of a request entry.
202-
A request entry is truncated if this size is exceeded.
203-
204-
| Type: integer
205-
| Default: 16384
206-
| Environment variable: TT_FLIGHTREC_REQUESTS_MAX_REQ_SIZE
207-
53+
Reading flight recordings
54+
-------------------------
20855

209-
.. _cfg_flightrec_requests_max_res_size:
56+
Since:** :doc:`3.0.0 </release/3.0.0>` version, you can read flight recordings using the API provided by the
57+
``flightrec`` module. To open and read ``*.ttfr`` files, use the Lua API:
21058

211-
.. confval:: flightrec_requests_max_res_size
59+
.. include:: /release/3.0.0.rst
60+
:start-after: 3-0-flight-recorder-begin
61+
:end-before: 3-0-flight-recorder-end
21262

213-
Specifies the maximum size (in bytes) of a response entry.
214-
A response entry is truncated if this size is exceeded.
21563

216-
| Type: integer
217-
| Default: 16384
218-
| Environment variable: TT_FLIGHTREC_REQUESTS_MAX_RES_SIZE

0 commit comments

Comments
 (0)