Skip to content

Commit 9159fe8

Browse files
committed
flightrec: review fixes
1 parent 7026a74 commit 9159fe8

File tree

4 files changed

+52
-65
lines changed

4 files changed

+52
-65
lines changed

doc/code_snippets/snippets/config/instances.enabled/flightrec/config.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,8 @@ groups:
88
listen:
99
- uri: '127.0.0.1:3301'
1010
flightrec:
11-
enabled: true
11+
enabled: true
12+
logs_size: 10485800
13+
logs_log_level: 5
14+
metrics_period: 240
15+
requests_size: 10485760

doc/enterprise/flight_recorder.rst

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. _enterprise-flight-recorder:
1+
.. _enterprise-flight-recorder:
22

33
Flight recorder
44
===============
@@ -15,7 +15,6 @@ gathers various information about a working Tarantool instance, such as:
1515
This information helps you investigate incidents related
1616
to :ref:`crashing <admin-disaster_recovery>` a Tarantool instance.
1717

18-
1918
.. _enterprise-flight-recorder_enable:
2019

2120
Enabling the flight recorder
@@ -24,17 +23,16 @@ Enabling the flight recorder
2423
The flight recorder is disabled by default and can be enabled and configured for
2524
a specific Tarantool instance.
2625
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.
26+
configuration option to ``true``.
2827

2928
.. literalinclude:: /code_snippets/snippets/replication/instances.enabled/flightrec/config.yaml
3029
:language: yaml
3130
:start-at: flightrec:
3231
:end-at: enabled: true
3332
:dedent:
3433

35-
3634
After ``flightrec_enabled`` is set to ``true``, the flight recorder starts collecting data in the flight recording file ``current.ttfr``.
37-
This file is stored in the :ref:`memtx_dir <cfg_basic-memtx_dir>` directory.
35+
This file is stored in the ``memtx.dir`` directory.
3836
By default, the directory is ``var/log/{{ instance_name }}/<file_name>.ttfr``.
3937

4038
If the instance crashes and reboots, Tarantool rotates the flight recording:
@@ -43,21 +41,33 @@ and the new ``current.ttfr`` file is created for collecting data.
4341
In the case of correct shutdown (for example, using ``os.exit()``),
4442
Tarantool continues writing to the existing ``current.ttfr`` file after restart.
4543

46-
.. NOTE::
44+
.. NOTE::
4745

4846
Note that old flight recordings should be removed manually.
4947

5048

51-
See also: :ref:`Flight recorder configuration options <configuration_reference_flightrec>`.
49+
.. _enterprise-flight-recorder_configure:
50+
51+
Configuring the flight recorder
52+
-------------------------------
53+
54+
When the flight recorder is enabled, you can set the options related to :ref:`logging <cfg_logging-log>`,
55+
:ref:`metrics <metrics-reference>`, and storing the :ref:`request and response <internals-requests_responses>` data.
5256

53-
Reading flight recordings
54-
-------------------------
57+
The ``flightrec`` configuration might look as follows:
5558

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:
59+
.. literalinclude:: /code_snippets/snippets/replication/instances.enabled/flightrec/config.yaml
60+
:language: yaml
61+
:start-at: flightrec:
62+
:end-at:
63+
:dedent:
5864

59-
.. include:: /release/3.0.0.rst
60-
:start-after: 3-0-flight-recorder-begin
61-
:end-before: 3-0-flight-recorder-end
65+
In the configuration, the following options are set:
6266

67+
* :ref:`flightrec.logs_size <configuration_reference_flightrec_logs_size>` -- a log storage size in bytes
68+
* :ref:`flightrec.logs_log_level <configuration_reference_flightrec_logs_log_level>` -- a :ref:`log_level <cfg_logging-log_level>`
69+
* :ref:`flightrec.metrics_period <configuration_reference_flightrec_metrics_period>` -- the number of seconds to store metrics after the dump
70+
* :ref:`flightrec.metrics_interval <configuration_reference_flightrec_metrics_interval>` -- the frequency of metrics dumps
71+
* :ref:`flightrec.metrics_interval <configuration_reference_flightrec_metrics_interval>` -- a storage size for the request and response data
6372

73+
Read more: :ref:`Flight recorder configuration options <configuration_reference_flightrec>`.

doc/reference/configuration/configuration_reference.rst

Lines changed: 17 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -502,21 +502,27 @@ flightrec
502502

503503
Configuring ``flightrec`` parameters is available in the `Enterprise Edition <https://www.tarantool.io/compare/>`_ only.
504504

505-
506505
The ``flightrec`` section describes options related to the :ref:`flight recorder <enterprise-flight-recorder>` configuration.
507-
Note that all options are dynamic and can be changed at runtime.
508506

509507
.. NOTE::
510508

511509
``flightrec`` can be defined in any :ref:`scope <configuration_scopes>`.
512510

513-
To enable flight recorder, set the ``flightrec.enabled`` option to ``true`.
511+
* :ref:`flightrec.enabled <configuration_reference_flightrec_enabled>`
512+
* :ref:`flightrec.logs_size <configuration_reference_flightrec_logs_size>`
513+
* :ref:`flightrec.logs_max_msg_size <configuration_reference_flightrec_logs_max_msg_size>`
514+
* :ref:`flightrec.logs_log_level <configuration_reference_flightrec_logs_log_level>`
515+
* :ref:`flightrec.metrics_period <configuration_reference_flightrec_metrics_period>`
516+
* :ref:`flightrec.metrics_interval <configuration_reference_flightrec_metrics_interval>`
517+
* :ref:`flightrec.requests_size <configuration_reference_flightrec_requests_size>`
518+
* :ref:`flightrec.requests_max_req_size <configuration_reference_flightrec_requests_max_req_size>`
519+
* :ref:`flightrec.requests_max_res_size <configuration_reference_flightrec_requests_max_res_size>`
514520

515521
.. _configuration_reference_flightrec_enabled:
516522

517523
.. confval:: flightrec.enabled
518524

519-
Whether the :ref:`flight recorder <enterprise-flight-recorder>` is enabled.
525+
Enable the :ref:`flight recorder <enterprise-flight-recorder>`.
520526

521527
| Type: boolean
522528
| Default: false
@@ -533,22 +539,10 @@ To enable flight recorder, set the ``flightrec.enabled`` option to ``true`.
533539
Specify the directory used to store flight recordings (``*.ttfr`` files).
534540
535541
| Type: string
536-
| Default: :ref:`memtx_dir <cfg_basic-memtx_dir>`
542+
| Default: memtx.dir
537543
| Environment variable: TT_FLIGHTREC_DIR
538544
539545
540-
.. _configuration_reference_flightrec_logs:
541-
542-
Logs
543-
~~~~
544-
545-
This section describes the flight recorder settings related to :ref:`logging <cfg_logging-log>`.
546-
For example, you can configure a more detailed logging level in the flight recorder for deeper analysis.
547-
548-
* :ref:`flightrec.logs_size <configuration_reference_flightrec_logs_size>`
549-
* :ref:`flightrec.logs_max_msg_size <configuration_reference_flightrec_logs_max_msg_size>`
550-
* :ref:`flightrec.logs_log_level <configuration_reference_flightrec_logs_log_level>`
551-
552546
.. _configuration_reference_flightrec_logs_size:
553547

554548
.. confval:: flightrec.logs_size
@@ -578,6 +572,7 @@ For example, you can configure a more detailed logging level in the flight recor
578572
.. confval:: flightrec.logs_log_level
579573

580574
Specify the level of detail the log has.
575+
The default value is 6 (``VERBOSE``).
581576
You can learn more about log levels from the :ref:`log_level <cfg_logging-log_level>`
582577
option description.
583578
Note that the ``flightrec.logs_log_level`` value might differ from ``log_level``.
@@ -586,17 +581,6 @@ For example, you can configure a more detailed logging level in the flight recor
586581
| Default: 6
587582
| Environment variable: TT_FLIGHTREC_LOGS_LOG_LEVEL
588583
589-
.. _configuration_reference_flightrec_metrics:
590-
591-
Metrics
592-
~~~~~~~
593-
594-
This section describes the flight recorder settings related to collecting
595-
:ref:`metrics <metrics-reference>`.
596-
597-
* :ref:`flightrec.metrics_period <configuration_reference_flightrec_metrics_period>`
598-
* :ref:`flightrec.metrics_interval <configuration_reference_flightrec_metrics_interval>`
599-
600584
.. _configuration_reference_flightrec_metrics_period:
601585

602586
.. confval:: flightrec.metrics_period
@@ -622,27 +606,15 @@ This section describes the flight recorder settings related to collecting
622606
| Minimum: 0.001
623607
| Environment variable: TT_FLIGHTREC_METRICS_INTERVAL
624608
625-
.. NOTE::
626-
627-
Given that the average size of a metrics entry is 2 kB,
628-
you can estimate the size of the metrics storage as follows:
609+
.. NOTE::
629610

630-
.. code-block:: console
611+
Given that the average size of a metrics entry is 2 kB,
612+
you can estimate the size of the metrics storage as follows:
631613

632-
(flightrec_metrics_period / flightrec_metrics_interval) * 2 kB
614+
.. code-block:: console
633615
616+
(flightrec_metrics_period / flightrec_metrics_interval) * 2 kB
634617
635-
.. _configuration_reference_flightrec_requests:
636-
637-
Requests
638-
~~~~~~~~
639-
640-
This section lists the flight recorder settings related to
641-
storing the :ref:`request and response <internals-requests_responses>` data.
642-
643-
* :ref:`flightrec.requests_size <configuration_reference_flightrec_requests_size>`
644-
* :ref:`flightrec.requests_max_req_size <configuration_reference_flightrec_requests_max_req_size>`
645-
* :ref:`flightrec.requests_max_res_size <configuration_reference_flightrec_requests_max_res_size>`
646618
647619
.. _configuration_reference_flightrec_requests_size:
648620

doc/release/3.0.0.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -309,10 +309,11 @@ With the 3.0 version, you can read flight recordings using the API provided by t
309309

310310
To enable the flight recorder in a YAML file, set ``flightrec.enabled`` to true:
311311

312-
.. code-block:: yaml
313-
314-
flightrec:
315-
enabled: true
312+
.. literalinclude:: /code_snippets/snippets/replication/instances.enabled/flightrec/config.yaml
313+
:language: yaml
314+
:start-at: flightrec:
315+
:end-at: enabled: true
316+
:dedent:
316317

317318
Then, you can use the Lua API to open and read ``*.ttfr`` files:
318319

@@ -324,7 +325,7 @@ Then, you can use the Lua API to open and read ``*.ttfr`` files:
324325
---
325326
...
326327
327-
app:instance001> flightrec_file = flightrec.open('var/lib/instance001/current.ttfr')
328+
app:instance001> flightrec_file = flightrec.open('var/lib/instance001/20231225T085435.ttfr')
328329
---
329330
...
330331

0 commit comments

Comments
 (0)