feat: introduce pydantic-settings for config definition and validation (#5202)
Co-authored-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
23
api/configs/extra/sentry_configs.py
Normal file
23
api/configs/extra/sentry_configs.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel, Field, PositiveFloat
|
||||
|
||||
|
||||
class SentryConfigs(BaseModel):
|
||||
"""
|
||||
Sentry configs
|
||||
"""
|
||||
SENTRY_DSN: Optional[str] = Field(
|
||||
description='Sentry DSN',
|
||||
default=None,
|
||||
)
|
||||
|
||||
SENTRY_TRACES_SAMPLE_RATE: PositiveFloat = Field(
|
||||
description='Sentry trace sample rate',
|
||||
default=1.0,
|
||||
)
|
||||
|
||||
SENTRY_PROFILES_SAMPLE_RATE: PositiveFloat = Field(
|
||||
description='Sentry profiles sample rate',
|
||||
default=1.0,
|
||||
)
|
||||
Reference in New Issue
Block a user