sentry-laravel icon indicating copy to clipboard operation
sentry-laravel copied to clipboard

`client_sample_rate` for auto instrumented Queue spans is always 1 in UI even if sampled at a lower rate.

Open Fwang36 opened this issue 4 months ago • 8 comments

How do you use Sentry?

Sentry SaaS (sentry.io)

SDK version

4.8.0

Laravel version

11.9

Steps to reproduce

  1. Set up tracesSampler to conditionally sample an auto instrumented Queue span.
      $transactionName = \Illuminate\Support\Str::of($context->getTransactionContext()?->getName())->value();


      if (str_contains($transactionName, LogTestMessage::class)) {

          return 0.1;
      }
      
      return 0.99;
  1. Enable the logger and check the logs to see the sampling occuring.
  1. Search for the event Id in the logs and see that the samping rate is set to 1.

Link to the transaction

Expected result

client_sample_rate should show as .1 like I have set in the tracesSampler

Actual result

client_sample_rate shows as 1 even though I do not have 1 set anywhere in my tracesSampler

Fwang36 avatar Oct 09 '24 14:10 Fwang36