SentryConfig#
- pydantic model safir.sentry.SentryConfig#
Values from environment variables to configure Sentry.
Most Safir apps should define at least these paramters when initializing Sentry. These are taken from enviroment variables and not part of the main app config class because we want to initialize Sentry before the app configuration is initialized.
- Parameters:
_nested_model_default_partial_update (
bool|None, default:None)_env_prefix_target (
Literal['variable','alias','all'] |None, default:None)_env_file (
Path|str|Sequence[Path|str] |None, default:PosixPath('.'))_cli_parse_args (
bool|list[str] |tuple[str,...] |None, default:None)_cli_settings_source (
CliSettingsSource[Any] |None, default:None)_cli_implicit_flags (
bool|Literal['dual','toggle'] |None, default:None)_cli_kebab_case (
bool|Literal['all','no_enums'] |None, default:None)_cli_shortcuts (
Mapping[str,str|list[str]] |None, default:None)_secrets_dir (
Path|str|Sequence[Path|str] |None, default:None)_build_sources (
tuple[tuple[PydanticBaseSettingsSource,...],dict[str,Any]] |None, default:None)values (
Any)
- Fields:
- field dsn: Annotated[str, FieldInfo(annotation=NoneType, required=True, alias_priority=2, validation_alias='SENTRY_DSN', description='DSN for sending events to Sentry')] [Required]#
DSN for sending events to Sentry
- field environment: Annotated[str, FieldInfo(annotation=NoneType, required=True, alias_priority=2, validation_alias='SENTRY_ENVIRONMENT', description='Phalanx name of the Rubin Science Platform environment')] [Required]#
Phalanx name of the Rubin Science Platform environment
- field traces_sample_rate: Annotated[float, FieldInfo(annotation=NoneType, required=True, alias_priority=2, validation_alias='SENTRY_TRACES_SAMPLE_RATE', description='Percentage of transactions to send to Sentry, expressed as a float between 0 and 1. 0 means send no traces, 1 means send every trace.', metadata=[Ge(ge=0), Le(le=1)])] = 0#
Percentage of transactions to send to Sentry, expressed as a float between 0 and 1. 0 means send no traces, 1 means send every trace.
- Constraints:
ge = 0
le = 1
- classmethod settings_customise_sources(settings_cls, init_settings, env_settings, dotenv_settings, file_secret_settings)#
Define the sources and their order for loading the settings values.
- Args:
settings_cls: The Settings class. init_settings: The
InitSettingsSourceinstance. env_settings: TheEnvSettingsSourceinstance. dotenv_settings: TheDotEnvSettingsSourceinstance. file_secret_settings: TheSecretsSettingsSourceinstance.- Returns:
A tuple containing the sources and their order for loading the settings values.