Skip to content

Comments

Remove max_breadcrumbs limit#1890

Merged
cleptric merged 6 commits intogetsentry:masterfrom
FeBe95:remove-max-breadcrumbs-limits
Sep 12, 2025
Merged

Remove max_breadcrumbs limit#1890
cleptric merged 6 commits intogetsentry:masterfrom
FeBe95:remove-max-breadcrumbs-limits

Conversation

@FeBe95
Copy link
Contributor

@FeBe95 FeBe95 commented Sep 4, 2025

Description

This PR removes the limit for the max_breadcrumbs option, which was previously set to 100.

Reasoning

The documentation clearly states there isn't a hard upper limit, but rather a soft limit imposed due to the maximum payload size.

max_breadcrumbs

Type int
Default 100

This variable controls the total amount of breadcrumbs that should be captured. This defaults to 100, but you can set this to any number. However, you should be aware that Sentry has a maximum payload size and any events exceeding that payload size will be dropped.

cursor[bot]

This comment was marked as outdated.

@Jean85
Copy link
Contributor

Jean85 commented Sep 4, 2025

Not putting a limit on breadcrumbs led to memory leaks in the past, especially in long running processes (like a queue consumer, i.e. Symfony Messenger' message:consume command).

I would advise against not having a default limit.

@FeBe95
Copy link
Contributor Author

FeBe95 commented Sep 4, 2025

I haven't thought about memory issues yet. Thanks for bringing that up! However, I believe that "blocking" users from increasing this value to 100+ is not ideal. I am maintaining a project that heavily uses Sentry's breadcrumbs feature. We are hitting the default limit surprisingly often.

I guess, we could warn about potential memory issues with an increased limit in the docs. What do you think?


P.S. The "bug" that the cursor bot mentioned is an intentional change, to keep it consistent with other similar options, e.g. max_value_length. They also don't have a range check.

$resolver->setAllowedTypes('max_value_length', 'int');

@cleptric
Copy link
Member

cleptric commented Sep 5, 2025

I think allowing to send more breadcrumbs should be mostly fine. I would however recommend to maybe consider switching to logs in the long run.

@cleptric cleptric self-assigned this Sep 5, 2025
cursor[bot]

This comment was marked as outdated.

Using `$value >= 0` will also work with `null` values
@FeBe95 FeBe95 requested a review from cleptric September 11, 2025 11:28
Copy link
Member

@cleptric cleptric left a comment

Choose a reason for hiding this comment

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

Thanks!

@cleptric cleptric merged commit 03b51d1 into getsentry:master Sep 12, 2025
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants