Skip to content

traceSampler doesn't work with @sentry/cloudflare #18126

@jahands

Description

@jahands

Is there an existing issue for this?

How do you use Sentry?

Self-hosted/on-premise

Which SDK are you using?

@sentry/cloudflare

SDK Version

10.23.0

Framework Version

plain fetch handler

Link to Sentry event

No response

Reproduction Example/SDK Setup

// index.ts
export default Sentry.withSentry(
	(env: Env) => ({
		dsn: env.SENTRY_DSN,
		tracesSampleRate: 1.0, // should be ignored, but we sample anyway
		traceSampler: (env: Env) => {
			return 0.0 // doesn't work
		}}),
	{
		fetch: (req: Request) => new Response('hello')
	}
)

Steps to Reproduce

try using traceSampler with Cloudflare workers

Expected Result

traceSampler function to be invoked and control sampling

Actual Result

traceSampler is ignored and only traceSampleRate works

Additional Context

Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.

Metadata

Metadata

Assignees

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions