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

TracesSamplerCallback allows returning null in Java SDK #4048

Open
adinauer opened this issue Jan 14, 2025 · 1 comment
Open

TracesSamplerCallback allows returning null in Java SDK #4048

adinauer opened this issue Jan 14, 2025 · 1 comment

Comments

@adinauer
Copy link
Member

adinauer commented Jan 14, 2025

Description

Docs do not mention it's possible to return null from TracesSamplerCallback (https://develop.sentry.dev/sdk/telemetry/traces/#tracessampler).

The question is whether we should align with other SDKs in not allowing to return null or if we consider this a feature worth keeping.

PRO for keeping it:

  • Easy for customers to customize sampling decision only for things they care about and let the SDK perform its default handling on the rest

Consequences of removing this possibility:

  • Customers always have to return a sampling rate
  • They also need to handle copying the parent sampling decision
  • Customers have to build their own mechanism for supplying a sample rate via ENV vars or config if they need it or read it from SentryOptions

Also see python: https://github.com/getsentry/sentry-python/blob/master/sentry_sdk/tracing.py#L1070C9-L1090

@adinauer
Copy link
Member Author

Let's keep current behaviour and document what's possible in https://docs.sentry.io/platforms/java/configuration/sampling/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Needs Discussion
Development

No branches or pull requests

1 participant