Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How is max_items reset since RollbarLogger is set as singleton #139

Open
ls-paulo opened this issue Jun 21, 2022 · 1 comment
Open

How is max_items reset since RollbarLogger is set as singleton #139

ls-paulo opened this issue Jun 21, 2022 · 1 comment
Assignees
Labels
Type: Question Request for information about a components operation.
Milestone

Comments

@ls-paulo
Copy link

ls-paulo commented Jun 21, 2022

According to the docs, max_items is "Maximum number of items sent in a single app request/response cycle".

The RollbarServiceProvider defines RollbarLogger as a singleton, in which the same instance will be returned on subsequent calls into the container.

Given the above, wouldn't be more appropriate to use scoped instead? As it would do exactly what the Rollbar docs state for max_items config?

@danielmorell danielmorell added the Type: Question Request for information about a components operation. label Feb 24, 2023
@danielmorell danielmorell self-assigned this Feb 24, 2023
@danielmorell danielmorell added this to the v8.1.0 milestone Oct 25, 2024
@danielmorell
Copy link
Collaborator

You are correct that this would be an issue if running under Octane.

I looked into this a bit, and I think there will be some more changes required in how the core PHP SDK is configured since the default Rollbar::init() method will retain the previous RollbarLogger instance meaning RollbarLogger::reportCount may not start at 0 for each request/response cycle.

My initial thought is using Rollbar::scope() along with Laravel's Application:scoped() method should give us an isolated RollbarLogger instance.

There may need to also be some work to isolate the telemetry queue once that released.

However, I need to spend more time making sure the core SDK is safe to run concurrently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Question Request for information about a components operation.
Projects
None yet
Development

No branches or pull requests

2 participants