diff --git a/conf/coverstore.yml b/conf/coverstore.yml index 44c538f481c..1bccde68766 100644 --- a/conf/coverstore.yml +++ b/conf/coverstore.yml @@ -13,4 +13,7 @@ sentry: # Dummy endpoint; where sentry logs are sent to dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0' traces_sample_rate: 1.0 + # Continuous profiling configuration (recommended for Sentry SDK >= 2.24.1) + profile_session_sample_rate: 0.001 + profile_lifecycle: 'trace' environment: 'local' diff --git a/conf/openlibrary.yml b/conf/openlibrary.yml index b46c4c427dc..a02fba168e0 100644 --- a/conf/openlibrary.yml +++ b/conf/openlibrary.yml @@ -178,6 +178,9 @@ sentry: dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0' traces_sample_rate: 1.0 profiles_sample_rate: 0.001 + # Continuous profiling configuration (recommended for Sentry SDK >= 2.24.1) + profile_session_sample_rate: 0.001 + profile_lifecycle: 'trace' environment: 'local' sentry_cron_jobs: diff --git a/openlibrary/utils/sentry.py b/openlibrary/utils/sentry.py index ac363674291..21bb1d6489d 100644 --- a/openlibrary/utils/sentry.py +++ b/openlibrary/utils/sentry.py @@ -70,6 +70,11 @@ def init(self): environment=getenv('OL_SENTRY_ENVIRONMENT', self.config['environment']), traces_sample_rate=self.config.get('traces_sample_rate', 0.0), profiles_sample_rate=self.config.get('profiles_sample_rate', 0.0), + # Continuous profiling configuration + profile_session_sample_rate=self.config.get( + 'profile_session_sample_rate', 0.0 + ), + profile_lifecycle=self.config.get('profile_lifecycle', 'trace'), release=get_software_version(), )