@@ -162,6 +162,7 @@ class CLIArgs:
162
162
setting_file : Path
163
163
preset_file : Path | None
164
164
disable_mutable_api : bool
165
+ disable_sentry : bool
165
166
# 以下は極力 VOICEVOX ENGINE との差分を最小限にするための互換用
166
167
# 対応する引数は AivisSpeech Engine では常に無効化されている
167
168
voicevox_dir : Path | None = None # 常に None
@@ -310,6 +311,12 @@ def read_cli_arguments(envs: Envs) -> CLIArgs:
310
311
),
311
312
)
312
313
314
+ parser .add_argument (
315
+ "--disable_sentry" ,
316
+ action = "store_true" ,
317
+ help = "Sentry によるエラーログ収集を無効化します。" ,
318
+ )
319
+
313
320
args_dict = vars (parser .parse_args ())
314
321
315
322
# NOTE: 複数個の同名引数に基づいてリスト化されるため `CLIArgs` で複数形にリネームされている
@@ -344,25 +351,28 @@ def main() -> None:
344
351
345
352
# Sentry によるエラートラッキングを開始
346
353
# ref: https://docs.sentry.io/platforms/python/integrations/fastapi/
347
- sentry_sdk .init (
348
- dsn = "https://ebdf5cc288b3ab31a262186329ff3a95@o4508551725383680.ingest.us.sentry.io/4508555159470080" ,
349
- release = f"AivisSpeech-Engine@{ __version__ } " ,
350
- environment = "development" if __version__ == "latest" else "production" ,
351
- # Set traces_sample_rate to 1.0 to capture 100%
352
- # of transactions for tracing.
353
- traces_sample_rate = 1.0 ,
354
- _experiments = {
355
- # Set continuous_profiling_auto_start to True
356
- # to automatically start the profiler on when
357
- # possible.
358
- "continuous_profiling_auto_start" : True ,
359
- },
360
- )
354
+ if not args .disable_sentry :
355
+ sentry_sdk .init (
356
+ dsn = "https://ebdf5cc288b3ab31a262186329ff3a95@o4508551725383680.ingest.us.sentry.io/4508555159470080" ,
357
+ release = f"AivisSpeech-Engine@{ __version__ } " ,
358
+ environment = "development" if __version__ == "latest" else "production" ,
359
+ # Set traces_sample_rate to 1.0 to capture 100%
360
+ # of transactions for tracing.
361
+ traces_sample_rate = 1.0 ,
362
+ _experiments = {
363
+ # Set continuous_profiling_auto_start to True
364
+ # to automatically start the profiler on when
365
+ # possible.
366
+ "continuous_profiling_auto_start" : True ,
367
+ },
368
+ )
361
369
362
370
# 起動時の可能な限り早い段階で実行結果をキャッシュしておくのが重要
363
371
generate_user_agent ("GPU" if args .use_gpu is True else "CPU" )
364
372
365
373
logger .info (f"AivisSpeech Engine version { __version__ } " )
374
+ if args .disable_sentry :
375
+ logger .info ("Sentry error tracking is disabled." )
366
376
logger .info (f"Engine root directory: { engine_root ()} " )
367
377
logger .info (f"User data directory: { get_save_dir ()} " )
368
378
0 commit comments