Skip to content

Logs: Not sent when there are always logs being collected under the flush timeout #18204

@lucas-zimerman

Description

@lucas-zimerman

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/react

SDK Version

10.24.0

Framework Version

No response

Link to Sentry event

No response

Reproduction Example/SDK Setup

let counter = 0;
const sender = () => {
  Sentry.logger.info(`never flushed number ${counter}`);
  setTimeout(sender, 2000);
};

sender();

Steps to Reproduce

run the snippet code and you will notice that even after minutes there will be no logs in spotlight/sentry

Expected Result

logs being captured

Actual Result

no logs being captured.

Additional Context

I read the client code on the latest commit and it seems the same as the one that presents the issue.
The main problem is for every log captured, the flush timeout is reset to a new timeout delay.
If we have a constant inflow of logs, we will never send those logs.

EDIT: It seems like it's actually sent, but only when we reach 100logs, meaning that the sample loop takes 2 minutes and 33 seconds before sending it.

Image spotlight tricked me in thinking the logs were partially sent but all of them were correctly sent at sentry.io

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions