Skip to content

Conversation

@alexander-alderman-webb
Copy link
Contributor

@alexander-alderman-webbalexander-alderman-webb commented Nov 3, 2025

Description

Add a toggle for metrics in the form of an enable_metrics flag that defaults to True.

The PR is not undoing #5046 because

Issues

Reminders

@codecov
Copy link

codecovbot commented Nov 3, 2025

Codecov Report

❌ Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.93%. Comparing base (8965821) to head (58a65d2).
⚠️ Report is 5 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing linesPatch %Lines
sentry_sdk/utils.py50.00%1 Missing and 1 partial ⚠️
Additional details and impacted files
@@ Coverage Diff @@## master #5056 +/- ## ========================================== - Coverage 83.96% 83.93% -0.03%  ========================================== Files 179 179 Lines 17894 17900 +6 Branches 3177 3179 +2 ========================================== Hits 15024 15024 - Misses 1900 1907 +7 + Partials 970 969 -1 
Files with missing linesCoverage Δ
sentry_sdk/client.py84.09% <100.00%> (+0.44%)⬆️
sentry_sdk/consts.py99.40% <ø> (ø)
sentry_sdk/utils.py86.25% <50.00%> (-0.17%)⬇️

... and 3 files with indirect coverage changes

@alexander-alderman-webbalexander-alderman-webb marked this pull request as ready for review November 3, 2025 10:47
@alexander-alderman-webbalexander-alderman-webb requested a review from a team as a code ownerNovember 3, 2025 10:47
returnFalse

returnbool(options.get("enable_metrics", True))

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Metrics toggle ignores experimental flag, breaking compatibility

The has_metrics_enabled function only checks the top-level enable_metrics option, ignoring the experimental _experiments.enable_metrics option. This breaks backward compatibility for users disabling metrics through the experimental flag.

Fix in CursorFix in Web

Copy link
ContributorAuthor

@alexander-alderman-webbalexander-alderman-webbNov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but I couldn't think of a good way to combine them because the experimental option defaulted to False and the stable option defaults to True.

@alexander-alderman-webbalexander-alderman-webb merged commit 6a76cc5 into masterNov 5, 2025
129 of 130 checks passed
@alexander-alderman-webbalexander-alderman-webb deleted the webb/enable_metrics_option branch November 5, 2025 07:50
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@alexander-alderman-webb@sl0thentr0py