3
3
Flight recorder
4
4
===============
5
5
6
+ **Example on GitHub **: `flightrec <https://github.com/tarantool/doc/tree/latest/doc/code_snippets/snippets/config/instances.enabled/flightrec >`_
7
+
6
8
The flight recorder available in the Enterprise Edition is an event collection tool that
7
9
gathers various information about a working Tarantool instance, such as:
8
10
9
11
* logs
10
-
11
12
* metrics
12
-
13
13
* requests and responses
14
14
15
15
This information helps you investigate incidents related
16
16
to :ref: `crashing <admin-disaster_recovery >` a Tarantool instance.
17
17
18
18
19
- .. _ enable :
19
+ .. _ enterprise-flight-recorder_enable :
20
20
21
21
Enabling the flight recorder
22
22
----------------------------
23
23
24
24
The flight recorder is disabled by default and can be enabled and configured for
25
25
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.
29
28
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:
31
34
32
- box.cfg{ flightrec_enabled = true }
33
35
34
36
After ``flightrec_enabled `` is set to ``true ``, the flight recorder starts collecting data in the flight recording file ``current.ttfr ``.
35
37
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
+
36
40
If the instance crashes and reboots, Tarantool rotates the flight recording:
37
41
``current.ttfr `` is renamed to ``<timestamp>.ttfr `` (for example, ``20230411T050721.ttfr ``)
38
42
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.
44
48
Note that old flight recordings should be removed manually.
45
49
46
50
51
+ See also: :ref: `Flight recorder configuration options <configuration_reference_flightrec >`.
47
52
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
+ -------------------------
208
55
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:
210
58
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
212
62
213
- Specifies the maximum size (in bytes) of a response entry.
214
- A response entry is truncated if this size is exceeded.
215
63
216
- | Type: integer
217
- | Default: 16384
218
- | Environment variable: TT_FLIGHTREC_REQUESTS_MAX_RES_SIZE
0 commit comments