File tree 2 files changed +20
-1
lines changed
2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,10 @@ import type {DescribeTopicResult} from '../types/api/topic';
46
46
import type { TEvVDiskStateResponse } from '../types/api/vdisk' ;
47
47
import type { TUserToken } from '../types/api/whoami' ;
48
48
import 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' ;
50
53
import { prepareSortValue } from '../utils/filters' ;
51
54
import type { Nullable } from '../utils/typecheckers' ;
52
55
@@ -71,6 +74,20 @@ export class YdbEmbeddedAPI extends AxiosWrapper {
71
74
retryDelay : axiosRetry . exponentialDelay ,
72
75
} ) ;
73
76
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
+
74
91
// Interceptor to process OIDC auth
75
92
this . _axios . interceptors . response . use ( null , function ( error ) {
76
93
const response = error . response ;
Original file line number Diff line number Diff line change @@ -159,3 +159,5 @@ export const ENABLE_AUTOCOMPLETE = 'enableAutocomplete';
159
159
export const AUTOCOMPLETE_ON_ENTER = 'autocompleteOnEnter' ;
160
160
161
161
export 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