Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref(core): Move log message about invalid sample rate #15215

Merged
merged 5 commits into from
Feb 3, 2025

Conversation

lforst
Copy link
Member

@lforst lforst commented Jan 29, 2025

The location we logged a message about an invalid sample rate was way too central. Originally we only logged it in the sampler but nowadays it is used in a bunch of other places like replay or propagation logic where it makes no sense to log the message.

@@ -41,7 +41,12 @@ export function sampleSpan(
const parsedSampleRate = parseSampleRate(sampleRate);

if (parsedSampleRate === undefined) {
DEBUG_BUILD && logger.warn('[Tracing] Discarding transaction because of invalid sample rate.');
DEBUG_BUILD &&
logger.trace(
Copy link
Member

Choose a reason for hiding this comment

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

l: why use logger.trace here vs. logger.log or similar?

Copy link
Member Author

Choose a reason for hiding this comment

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

whoops, I used trace to debug. Switching back... Thanks!

Copy link
Contributor

github-actions bot commented Jan 29, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 22.94 KB -0.42% -97 B 🔽
@sentry/browser - with treeshaking flags 22.8 KB -0.52% -121 B 🔽
@sentry/browser (incl. Tracing) 35.78 KB -0.06% -19 B 🔽
@sentry/browser (incl. Tracing, Replay) 72.57 KB -0.04% -24 B 🔽
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 66.12 KB -0.03% -16 B 🔽
@sentry/browser (incl. Tracing, Replay with Canvas) 76.83 KB -0.03% -21 B 🔽
@sentry/browser (incl. Tracing, Replay, Feedback) 89.33 KB -0.03% -27 B 🔽
@sentry/browser (incl. Feedback) 39.63 KB -0.21% -85 B 🔽
@sentry/browser (incl. sendFeedback) 27.58 KB -0.32% -89 B 🔽
@sentry/browser (incl. FeedbackAsync) 32.35 KB -0.28% -91 B 🔽
@sentry/react 24.76 KB -0.33% -82 B 🔽
@sentry/react (incl. Tracing) 37.66 KB -0.07% -25 B 🔽
@sentry/vue 27.11 KB -0.1% -27 B 🔽
@sentry/vue (incl. Tracing) 37.49 KB -0.07% -25 B 🔽
@sentry/svelte 23.06 KB -0.39% -92 B 🔽
CDN Bundle 24.23 KB - -
CDN Bundle (incl. Tracing) 35.91 KB - -
CDN Bundle (incl. Tracing, Replay) 70.56 KB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 75.69 KB - -
CDN Bundle - uncompressed 70.83 KB - -
CDN Bundle (incl. Tracing) - uncompressed 106.57 KB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 217.42 KB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 229.99 KB - -
@sentry/nextjs (client) 38.63 KB -0.06% -22 B 🔽
@sentry/sveltekit (client) 36.29 KB -0.05% -18 B 🔽
@sentry/node 156.51 KB -0.01% -15 B 🔽
@sentry/node - without tracing 97.56 KB -0.09% -85 B 🔽
@sentry/aws-serverless 107.07 KB -0.02% -12 B 🔽

View base workflow run

@lforst lforst requested a review from mydea January 29, 2025 09:51
@lforst lforst requested a review from Lms24 January 29, 2025 10:08
@@ -20,7 +20,7 @@ export function hasTracingEnabled(
const options = maybeOptions || client?.getOptions();
return (
!!options &&
// Note: This check is `!= null`, meaning "nullish"
// Note: This check is `!= null`, meaning "nullish". `0` is not "nullish", `undefined` and `null` are. (This comment was brought to you by 15 minutes of questioning life)
Copy link
Member

Choose a reason for hiding this comment

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

lol <3

packages/core/src/tracing/sampling.ts Outdated Show resolved Hide resolved
Copy link

codecov bot commented Jan 29, 2025

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
696 1 695 301
View the top 1 failed tests by shortest run time
tracing/dsc-txn-name-update/test.ts updates the DSC when the txn name is updated and high-quality
Stack Traces | 30s run time
test.ts:12:11 updates the DSC when the txn name is updated and high-quality

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

@lforst lforst merged commit e4333e5 into develop Feb 3, 2025
145 checks passed
@lforst lforst deleted the lforst-rm-log-message-for-sample-rate branch February 3, 2025 09:30
Sign up for free to 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