Skip to content

Commit 9d85af3

Browse files
committed
Add: Sentry を導入
1 parent dfa21b0 commit 9d85af3

File tree

4 files changed

+97
-4
lines changed

4 files changed

+97
-4
lines changed

poetry.lock

+77-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ gputil = "^1.4.0"
8888
psutil = "^6.1.1"
8989
py-cpuinfo = "^9.0.0"
9090
wmi = {version = "^1.5.1", platform = "win32"}
91+
sentry-sdk = {version = "^2.19.2", extras = ["fastapi"]}
9192
# truststore は HTTPS 通信時にシステムにインストールされた証明書ストアを使うために必要
9293
## ref: https://github.com/psf/requests/issues/2966
9394
## ref: https://truststore.readthedocs.io/en/latest/

resources/engine_manifest_assets/dependency_licenses.json

+1-1
Large diffs are not rendered by default.

run.py

+18-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from pathlib import Path
2121
from typing import TextIO, TypeVar
2222

23+
import sentry_sdk
2324
import uvicorn
2425
from pydantic import TypeAdapter
2526

@@ -345,7 +346,23 @@ def main() -> None:
345346
if args.output_log_utf8:
346347
set_output_log_utf8()
347348

348-
# 起動の一番早い段階で実行結果をキャッシュしておくのが重要
349+
# Sentry によるエラートラッキングを開始
350+
sentry_sdk.init(
351+
dsn="https://ebdf5cc288b3ab31a262186329ff3a95@o4508551725383680.ingest.us.sentry.io/4508555159470080",
352+
release=f"AivisSpeech-Engine@{__version__}",
353+
environment="development" if __version__ == "latest" else "production",
354+
# Set traces_sample_rate to 1.0 to capture 100%
355+
# of transactions for tracing.
356+
traces_sample_rate=1.0,
357+
_experiments={
358+
# Set continuous_profiling_auto_start to True
359+
# to automatically start the profiler on when
360+
# possible.
361+
"continuous_profiling_auto_start": True,
362+
},
363+
)
364+
365+
# 起動時の可能な限り早い段階で実行結果をキャッシュしておくのが重要
349366
generate_user_agent("GPU" if args.use_gpu is True else "CPU")
350367

351368
logger.info(f"AivisSpeech Engine version {__version__}")

0 commit comments

Comments
 (0)