File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,7 +46,10 @@ import type {DescribeTopicResult} from '../types/api/topic';
4646import type { TEvVDiskStateResponse } from '../types/api/vdisk' ;
4747import type { TUserToken } from '../types/api/whoami' ;
4848import type { QuerySyntax } from '../types/store/query' ;
49- import { BINARY_DATA_IN_PLAIN_TEXT_DISPLAY } from '../utils/constants' ;
49+ import {
50+ BINARY_DATA_IN_PLAIN_TEXT_DISPLAY ,
51+ DEV_ENABLE_TRACING_FOR_ALL_REQUESTS ,
52+ } from '../utils/constants' ;
5053import { prepareSortValue } from '../utils/filters' ;
5154import type { Nullable } from '../utils/typecheckers' ;
5255
@@ -71,6 +74,20 @@ export class YdbEmbeddedAPI extends AxiosWrapper {
7174 retryDelay : axiosRetry . exponentialDelay ,
7275 } ) ;
7376
77+ // Make possible manually enable tracing for all requests
78+ // For development purposes
79+ this . _axios . interceptors . request . use ( function ( config ) {
80+ const enableTracing = settingsManager . readUserSettingsValue (
81+ DEV_ENABLE_TRACING_FOR_ALL_REQUESTS ,
82+ ) ;
83+
84+ if ( enableTracing ) {
85+ config . headers [ 'X-Want-Trace' ] = 1 ;
86+ }
87+
88+ return config ;
89+ } ) ;
90+
7491 // Interceptor to process OIDC auth
7592 this . _axios . interceptors . response . use ( null , function ( error ) {
7693 const response = error . response ;
Original file line number Diff line number Diff line change @@ -159,3 +159,5 @@ export const ENABLE_AUTOCOMPLETE = 'enableAutocomplete';
159159export const AUTOCOMPLETE_ON_ENTER = 'autocompleteOnEnter' ;
160160
161161export const IS_HOTKEYS_HELP_HIDDEN_KEY = 'isHotKeysHelpHidden' ;
162+
163+ export const DEV_ENABLE_TRACING_FOR_ALL_REQUESTS = 'enable_tracing_for_all_requests' ;
You can’t perform that action at this time.
0 commit comments