@@ -37,6 +37,7 @@ pub enum LogStoreConfig {
3737 username : Option < String > ,
3838 password : Option < String > ,
3939 index : String ,
40+ timeout_secs : u64 ,
4041 } ,
4142
4243 /// Loki (Grafana's log aggregation system)
@@ -134,9 +135,11 @@ impl LogStoreFactory {
134135 username,
135136 password,
136137 index,
138+ timeout_secs,
137139 } => {
140+ let timeout = std:: time:: Duration :: from_secs ( timeout_secs) ;
138141 let client = reqwest:: Client :: builder ( )
139- . timeout ( std :: time :: Duration :: from_secs ( 10 ) )
142+ . timeout ( timeout )
140143 . build ( )
141144 . map_err ( |e| LogStoreError :: InitializationFailed ( e. into ( ) ) ) ?;
142145
@@ -148,7 +151,7 @@ impl LogStoreFactory {
148151 } ;
149152
150153 Ok ( Arc :: new ( elasticsearch:: ElasticsearchLogStore :: new (
151- config, index,
154+ config, index, timeout ,
152155 ) ) )
153156 }
154157
@@ -219,11 +222,21 @@ impl LogStoreFactory {
219222 "subgraph" ,
220223 ) ;
221224
225+ // Default: 10 seconds query timeout
226+ // Configurable via GRAPH_LOG_STORE_ELASTICSEARCH_TIMEOUT environment variable
227+ let timeout_secs = config:: read_u64_with_fallback (
228+ & logger,
229+ "GRAPH_LOG_STORE_ELASTICSEARCH_TIMEOUT" ,
230+ "GRAPH_ELASTICSEARCH_TIMEOUT" ,
231+ 10 ,
232+ ) ;
233+
222234 Ok ( LogStoreConfig :: Elasticsearch {
223235 endpoint,
224236 username,
225237 password,
226238 index,
239+ timeout_secs,
227240 } )
228241 }
229242
@@ -264,13 +277,17 @@ impl LogStoreFactory {
264277 } )
265278 . map ( PathBuf :: from) ?;
266279
280+ // Default: 100MB per file (104857600 bytes)
281+ // Configurable via GRAPH_LOG_STORE_FILE_MAX_SIZE environment variable
267282 let max_file_size = config:: read_u64_with_fallback (
268283 & logger,
269284 "GRAPH_LOG_STORE_FILE_MAX_SIZE" ,
270285 "GRAPH_LOG_FILE_MAX_SIZE" ,
271- 100 * 1024 * 1024 , // 100MB default
286+ 100 * 1024 * 1024 ,
272287 ) ;
273288
289+ // Default: 30 days retention
290+ // Configurable via GRAPH_LOG_STORE_FILE_RETENTION_DAYS environment variable
274291 let retention_days = config:: read_u32_with_fallback (
275292 & logger,
276293 "GRAPH_LOG_STORE_FILE_RETENTION_DAYS" ,
0 commit comments