Skip to content

Comments

Reproduction for sentry-php#1999#2

Open
cleptric wants to merge 1 commit intomainfrom
repro/sentry-php-1999
Open

Reproduction for sentry-php#1999#2
cleptric wants to merge 1 commit intomainfrom
repro/sentry-php-1999

Conversation

@cleptric
Copy link
Member

Summary

This PR adds a reproduction for getsentry/sentry-php#1999

The reproduction demonstrates that the SDK incorrectly uses the sentry-sample_rate value from the baggage header to make a sampling decision when the sentry-trace header is missing.

How to Run

cd sentry-php/1999
composer install
php reproduce.php

Output

=== Reproduction for sentry-php#1999 ===

Configuration:
  traces_sample_rate: 0.0 (0% - should never sample)

Incoming Headers:
  sentry-trace: (not present)
  baggage: sentry-sample_rate=1.0,sentry-sampled=true,...

Result:
  Transaction sampled: YES

BUG CONFIRMED: Transaction was sampled despite traces_sample_rate=0.0
The SDK incorrectly used the baggage sample_rate (1.0) instead of the local config.

Expected Behavior

Without a sentry-trace header, the SDK should treat this as a new trace head and use the locally configured traces_sample_rate (0.0) instead of the baggage sample rate (1.0).

Demonstrates that the SDK incorrectly uses the baggage sample_rate
when the sentry-trace header is missing, instead of using the locally
configured traces_sample_rate.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

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.

1 participant