fix: adapt Sentry initialization to fix performance tracking not working#91
Merged
bolinocroustibat merged 1 commit intomainfrom Feb 2, 2026
Merged
fix: adapt Sentry initialization to fix performance tracking not working#91bolinocroustibat merged 1 commit intomainfrom
bolinocroustibat merged 1 commit intomainfrom
Conversation
maudetes
approved these changes
Feb 2, 2026
Contributor
maudetes
left a comment
There was a problem hiding this comment.
Ah well spotted, this may explain why it doesn't work properly.
Let's try this, thank you!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix Sentry performance tracking
Problem
After PR #87, Sentry performance tracking stopped working while error tracking continued to function normally.
Possible Cause
The
AioHttpIntegration()instance was being created at module import time inapi_tabular/core/sentry.py(when thesentry_kwargsdictionary was defined). This likely happened beforesentry_sdk.init()was called in the app modules, which may have prevented the integration from properly hooking into aiohttp's internals for performance tracking.Error tracking might have been still working because it doesn't require the same level of framework instrumentation - errors can be captured through exception handlers without needing to instrument the request/response cycle.
Solution
Converted
sentry_kwargsfrom a module-level dictionary to aget_sentry_kwargs()function that creates a freshAioHttpIntegration()instance each time it's called. This ensures the integration is instantiated right whensentry_sdk.init()is called, matching the original behavior before the refactor.