Skip to content

Conversation

@Eshaan-byte
Copy link

Summary

Fixes #11493 - Sentry profiling not working in production

This PR adds support for Sentry's continuous profiling, which is required for SDK versions 2.24.1 and later. The old transaction-based profiling approach using only profiles_sample_rate has been deprecated.

Changes Made

  • Added profile_session_sample_rate parameter to enable continuous profiling
  • Added profile_lifecycle parameter set to 'trace' mode for automatic profiling with active spans
  • Updated configuration files:
    • conf/openlibrary.yml
    • conf/coverstore.yml
  • Updated openlibrary/utils/sentry.py to pass the new parameters to sentry_sdk.init()
  • Maintained backward compatibility by keeping existing profiles_sample_rate

Technical Details

According to Sentry's documentation, continuous profiling requires:

  1. profile_session_sample_rate - Must be non-zero to enable continuous profiling
  2. profile_lifecycle - Set to 'trace' for automatic profiling with spans

The current SDK version (2.19.2) supports this configuration, and it will work with future updates.

Related Issues

Closes #11493

Resolves internetarchive#11493

This change updates the Sentry configuration to support continuous profiling,
which is required for Sentry SDK versions 2.24.1 and later.

Changes:
- Added profile_session_sample_rate parameter to enable continuous profiling
- Added profile_lifecycle parameter set to 'trace' mode for automatic profiling
- Updated both openlibrary.yml and coverstore.yml configuration files
- Maintained backward compatibility by keeping existing profiles_sample_rate

The old transaction-based profiling (profiles_sample_rate) has been deprecated
in favor of continuous profiling. This fix ensures profiling data is properly
collected and sent to Sentry.
@github-actions github-actions bot added the Priority: 2 Important, as time permits. [managed] label Nov 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: 2 Important, as time permits. [managed]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sentry profiling appears to no longer be working

2 participants