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

RequestFetcher doesn't work with `Sentry\Monolog\BreadcrumbHandler`

Open Dukecz opened this issue 1 year ago • 10 comments

How do you use Sentry?

Self-hosted / on-premises

SDK version

5.1.0

Steps to reproduce

With Sentry\Monolog\BreadcrumbHandler setup as here https://docs.sentry.io/platforms/php/guides/symfony/integrations/monolog/ the request in RequestFetcher keeps resetting to null so data like url are not sent to Sentry.

Expected result

Event request data like url are visible in Sentry.

Image

Actual result

Url is missing:

Image

Dukecz avatar Jan 16 '25 16:01 Dukecz

I don't see the correlation between breadcrumbs and the request fetcher, so please provide us with more infos, such as Symfony versions, how your app is run, etc.

cleptric avatar Jan 16 '25 19:01 cleptric

After further testing I have found out the problem is not BreadcrumbHandler but monolog buffer:

https://github.com/Dukecz/sentrysymfonycommand/blob/sentry-5/config/packages/monolog.yaml#L19

Dukecz avatar Jan 21 '25 16:01 Dukecz

The Monolog buffer has a specific option to avoid this specific issue, buffer_size, which limits the amount of log that are retained in memory (oldest are discarded).

Jean85 avatar Jan 21 '25 17:01 Jean85

As this doesn't seem to be an issue with the SDK, I'm closing the issue.

cleptric avatar Jan 21 '25 17:01 cleptric

@Jean85 buffer_size is unlimited by default, you can put whatever number you want and the problem persists. No messages are lost, they are just missing some data from RequestFetcher

@cleptric I am asking for reopen (and can rename title) as imo the RequestFetcher doesnt work with monolog buffer.

With unlimited buffer:

Image

Image

Without buffer:

Image

Image

Dukecz avatar Jan 22 '25 13:01 Dukecz

So you have a small reproducer? Can you share it with us?

Jean85 avatar Jan 23 '25 08:01 Jean85

So you have a small reproducer? Can you share it with us?

https://github.com/Dukecz/sentrysymfonycommand/tree/sentry-5

Dukecz avatar Jan 23 '25 14:01 Dukecz

@Jean85 @cleptric have you checked the exampled project? All you need to do is just set sentry url and open homepage with https://github.com/Dukecz/sentrysymfonycommand/blob/sentry-5/config/packages/monolog.yaml#L20 sentry buffer enabled/disabled.

Dukecz avatar Feb 14 '25 14:02 Dukecz

Thanks, we'll take a closer look.

cleptric avatar Feb 18 '25 07:02 cleptric

I'll take this one. I'm on it, the reproducer is setup. Let's dive to find the root cause.

welcoMattic avatar Mar 31 '25 17:03 welcoMattic

https://sentry.zendesk.com/agent/tickets/157319

cobyeastwood183 avatar Jul 15 '25 17:07 cobyeastwood183