sentry_config.py 966 B

1234567891011121314151617181920212223242526272829
  1. from typing import Optional
  2. from pydantic import Field, NonNegativeFloat
  3. from pydantic_settings import BaseSettings
  4. class SentryConfig(BaseSettings):
  5. """
  6. Configuration settings for Sentry error tracking and performance monitoring
  7. """
  8. SENTRY_DSN: Optional[str] = Field(
  9. description="Sentry Data Source Name (DSN)."
  10. " This is the unique identifier of your Sentry project, used to send events to the correct project.",
  11. default=None,
  12. )
  13. SENTRY_TRACES_SAMPLE_RATE: NonNegativeFloat = Field(
  14. description="Sample rate for Sentry performance monitoring traces."
  15. " Value between 0.0 and 1.0, where 1.0 means 100% of traces are sent to Sentry.",
  16. default=1.0,
  17. )
  18. SENTRY_PROFILES_SAMPLE_RATE: NonNegativeFloat = Field(
  19. description="Sample rate for Sentry profiling."
  20. " Value between 0.0 and 1.0, where 1.0 means 100% of profiles are sent to Sentry.",
  21. default=1.0,
  22. )