Skip to content

Commit 55bdd9a

Browse files
authored
[Config] Update 'Flight recorder configuration' to using a new config (#3995)
* Add `flightrec` reference section (YAML) * Update the Flight Recorder page Fixes #3669
1 parent 53f36a3 commit 55bdd9a

File tree

10 files changed

+245
-211
lines changed

10 files changed

+245
-211
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
flightrec:
2+
enabled: true
3+
logs_size: 10485800
4+
logs_log_level: 5
5+
metrics_period: 240
6+
metrics_interval: 0.5
7+
requests_size: 10485780
8+
9+
groups:
10+
group001:
11+
replicasets:
12+
replicaset001:
13+
instances:
14+
instance001:
15+
iproto:
16+
listen:
17+
- uri: '127.0.0.1:3301'
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: 34 additions & 178 deletions
Original file line numberDiff line numberDiff line change
@@ -1,218 +1,74 @@
1-
.. _enterprise-flight-recorder:
1+
.. _enterprise-flight-recorder:
22

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

18-
19-
.. _enable:
18+
.. _enterprise-flight-recorder_enable:
2019

2120
Enabling the flight recorder
2221
----------------------------
2322

2423
The flight recorder is disabled by default and can be enabled and configured for
2524
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{}``:
25+
To enable the flight recorder, set the :ref:`flightrec.enabled <configuration_reference_flightrec_enabled>`
26+
configuration option to ``true``.
27+
28+
.. literalinclude:: /code_snippets/snippets/config/instances.enabled/flightrec/config.yaml
29+
:language: yaml
30+
:start-at: flightrec:
31+
:end-at: enabled: true
32+
:dedent:
2933

30-
.. code-block:: lua
3134

32-
box.cfg{ flightrec_enabled = true }
35+
After ``flightrec.enabled`` is set to ``true``, the flight recorder starts collecting data in the flight recording file ``current.ttfr``.
36+
This file is stored in the ``snapshot.dir`` directory.
37+
By default, the directory is ``var/lib/{{ instance_name }}/<file_name>.ttfr``.
3338

34-
After ``flightrec_enabled`` is set to ``true``, the flight recorder starts collecting data in the flight recording file ``current.ttfr``.
35-
This file is stored in the :ref:`memtx_dir <cfg_basic-memtx_dir>` directory.
3639
If the instance crashes and reboots, Tarantool rotates the flight recording:
3740
``current.ttfr`` is renamed to ``<timestamp>.ttfr`` (for example, ``20230411T050721.ttfr``)
3841
and the new ``current.ttfr`` file is created for collecting data.
3942
In the case of correct shutdown (for example, using ``os.exit()``),
4043
Tarantool continues writing to the existing ``current.ttfr`` file after restart.
4144

42-
.. NOTE::
45+
.. NOTE::
4346

4447
Note that old flight recordings should be removed manually.
4548

4649

50+
.. _enterprise-flight-recorder_configure:
4751

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.
52+
Configuring a flight recorder
53+
-----------------------------
20354

204-
| Type: integer
205-
| Default: 16384
206-
| Environment variable: TT_FLIGHTREC_REQUESTS_MAX_REQ_SIZE
55+
When the flight recorder is enabled, you can set the options related to :ref:`logging <cfg_logging-log>`,
56+
:ref:`metrics <metrics-reference>`, and storing the :ref:`request and response <internals-requests_responses>` data.
20757

58+
The ``flightrec`` configuration might look as follows:
20859

209-
.. _cfg_flightrec_requests_max_res_size:
60+
.. literalinclude:: /code_snippets/snippets/config/instances.enabled/flightrec/config.yaml
61+
:language: yaml
62+
:start-at: flightrec:
63+
:end-at: 10485780
64+
:dedent:
21065

211-
.. confval:: flightrec_requests_max_res_size
66+
In the example, the following options are set:
21267

213-
Specifies the maximum size (in bytes) of a response entry.
214-
A response entry is truncated if this size is exceeded.
68+
* :ref:`flightrec.logs_size <configuration_reference_flightrec_logs_size>` -- a log storage size in bytes.
69+
* :ref:`flightrec.logs_log_level <configuration_reference_flightrec_logs_log_level>` -- a :ref:`log_level <cfg_logging-log_level>`.
70+
* :ref:`flightrec.metrics_period <configuration_reference_flightrec_metrics_period>` -- the number of seconds to store metrics after the dump.
71+
* :ref:`flightrec.metrics_interval <configuration_reference_flightrec_metrics_interval>` -- the frequency of metrics dumps in seconds.
72+
* :ref:`flightrec.requests_size <configuration_reference_flightrec_requests_size>` -- a storage size for the request and response data in bytes.
21573

216-
| Type: integer
217-
| Default: 16384
218-
| Environment variable: TT_FLIGHTREC_REQUESTS_MAX_RES_SIZE
74+
Read more: :ref:`Flight recorder configuration options <configuration_reference_flightrec>`.

doc/reference/configuration/cfg_authentication.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
Since :doc:`2.11.0 </release/2.11.0>`.
2626

27-
Specifies a period of time (in seconds) that a specific user should wait
27+
Specify a period of time (in seconds) that a specific user should wait
2828
for the next attempt after failed authentication.
2929

3030
With the configuration below, Tarantool refuses the authentication attempt if the previous
@@ -105,7 +105,7 @@
105105

106106
Since :doc:`2.11.0 </release/2.11.0>`.
107107

108-
Specifies the minimum number of characters for a password.
108+
Specify the minimum number of characters for a password.
109109

110110
The following example shows how to set the minimum password length to 10.
111111

@@ -181,7 +181,7 @@
181181

182182
Since :doc:`2.11.0 </release/2.11.0>`.
183183

184-
Specifies the maximum period of time (in days) a user can use the same password.
184+
Specify the maximum period of time (in days) a user can use the same password.
185185
When this period ends, a user gets the "Password expired" error on a login attempt.
186186
To restore access for such users, use :doc:`box.schema.user.passwd </reference/reference_lua/box_schema/user_passwd>`.
187187

@@ -207,7 +207,7 @@
207207

208208
Since :doc:`2.11.0 </release/2.11.0>`.
209209

210-
Specifies the number of unique new user passwords before an old password can be reused.
210+
Specify the number of unique new user passwords before an old password can be reused.
211211

212212
In the example below, a new password should differ from the last three passwords.
213213

doc/reference/configuration/cfg_flight_recorder.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
Since :doc:`2.11.0 </release/2.11.0>`.
3838

39-
Specifies the size (in bytes) of the log storage.
39+
Specify the size (in bytes) of the log storage.
4040
You can set this option to ``0`` to disable the log storage.
4141

4242
| Type: integer
@@ -51,7 +51,7 @@
5151

5252
Since :doc:`2.11.0 </release/2.11.0>`.
5353

54-
Specifies the maximum size (in bytes) of the log message.
54+
Specify the maximum size (in bytes) of the log message.
5555
The log message is truncated if its size exceeds this limit.
5656

5757
| Type: integer
@@ -67,7 +67,7 @@
6767

6868
Since :doc:`2.11.0 </release/2.11.0>`.
6969

70-
Specifies the level of detail the log has.
70+
Specify the level of detail the log has.
7171
You can learn more about log levels from the :ref:`log_level <cfg_logging-log_level>`
7272
option description.
7373
Note that the ``flightrec_logs_log_level`` value might differ from ``log_level``.
@@ -84,7 +84,7 @@
8484

8585
Since :doc:`2.11.0 </release/2.11.0>`.
8686

87-
Specifies the time period (in seconds) that defines how long metrics are stored from the moment of dump.
87+
Specify the time period (in seconds) that defines how long metrics are stored from the moment of dump.
8888
So, this value defines how much historical metrics data is collected up to the moment of crash.
8989
The frequency of metric dumps is defined by :ref:`flightrec_metrics_interval <cfg_flightrec_metrics_interval>`.
9090

@@ -100,7 +100,7 @@
100100

101101
Since :doc:`2.11.0 </release/2.11.0>`.
102102

103-
Specifies the time interval (in seconds) that defines the frequency of dumping metrics.
103+
Specify the time interval (in seconds) that defines the frequency of dumping metrics.
104104
This value shouldn't exceed :ref:`flightrec_metrics_period <cfg_flightrec_metrics_period>`.
105105

106106
.. NOTE::
@@ -125,7 +125,7 @@
125125

126126
Since :doc:`2.11.0 </release/2.11.0>`.
127127

128-
Specifies the size (in bytes) of storage for the request and response data.
128+
Specify the size (in bytes) of storage for the request and response data.
129129
You can set this parameter to ``0`` to disable a storage of requests and responses.
130130

131131
| Type: integer
@@ -141,7 +141,7 @@
141141

142142
Since :doc:`2.11.0 </release/2.11.0>`.
143143

144-
Specifies the maximum size (in bytes) of a request entry.
144+
Specify the maximum size (in bytes) of a request entry.
145145
A request entry is truncated if this size is exceeded.
146146

147147
| Type: integer
@@ -156,7 +156,7 @@
156156

157157
Since :doc:`2.11.0 </release/2.11.0>`.
158158

159-
Specifies the maximum size (in bytes) of a response entry.
159+
Specify the maximum size (in bytes) of a response entry.
160160
A response entry is truncated if this size is exceeded.
161161

162162
| Type: integer

0 commit comments

Comments
 (0)