Comments (2)
Hi @jwadhams - we've just released https://github.com/bugsnag/bugsnag-laravel/releases/tag/v2.25.0, which adds the max_breadcrumbs
config option 🎉
from bugsnag-laravel.
Hey @jwadhams, thanks for raising the issue and providing the repro to explain exactly what the issue you're seeing is. Sorry for the delay in getting back to you, we've been having some internal discussions this topic 😄 .
leaveBreadcrumb seems to correctly isolate data between Laravel queued jobs processed with Horizon workers. I love it, but sometimes, especially with query logging turned on, important breadcrumbs from early in the job appear to be pushed out by later ones.
Breadcrumbs are contextual to the job, so they should be specific to that one process. We've added a roadmap ticket to make the number of breadcrumbs a) configurable, and b) more than 25! We'll keep you posted.
In BugSnag, the Breadcrumbs never "cross the streams" but the Metadata routinely do. Using merge:true in setMetaData` only means one random status will be set, it doesn't guarantee the right one, because of the delay. (The delay in my real jobs is based on i/o)
Metadata, on the other hand (by comparison to breadcrumbs) is global when set in the app-level. You're right, using merge would condense the array down into a single element, and it wouldn't deterministically report the right state because the jobs are async. You could use a event-scoped callback on errors occuring inside of the job to set metadata.
In any case, I suspect that the increase to breadcrumb numbers would be a satisfactory solution long term anyway?
I noticed this alternate approach in the issues backlog, is using Tracker the preferred solution for queue workers? #448 It doesn't appear anywhere in the integration guide.
Using the Tracker
as the linked issue suggests should do what you want. However, it's intended for internal use, hence why it's not documented. This API is not ideal for public use, and so you'd need to merge the existing metadata manually to not lose the automatic metadata Bugsnag records:
/** @var \Illuminate\Queue\QueueManager $queueManager */
$queueManager->before(function (\Illuminate\Queue\Events\JobProcessing $event) {
$tracker = app(\Bugsnag\BugsnagLaravel\Queue\Tracker::class);
$tracker->set(
array_merge(
$tracker->get(),
[/* your metadata goes here */]
)
)
});
from bugsnag-laravel.
Related Issues (20)
- PHP 8.1 Deprecated messages HOT 7
- Session tracker throttling not working with some cache drivers (eg. Redis) HOT 3
- Prepare for Laravel 9 support HOT 5
- Ignore Exceptions in Laravel HOT 2
- Fails composer install for Laravel 9 HOT 2
- Laravel service provider: config is null HOT 5
- Updating minor version HOT 1
- Unable to create configured logger HOT 6
- PHP Fatal error: Declaration of Bugsnag\PsrLogger\BugsnagLogger::log HOT 4
- Vulnerable versions of Akaunting and Bookstack packages are used HOT 2
- Bugsnag Shows js stack trace and php error codes but no php stacktrace. HOT 2
- Delay session delivery to "after the response is sent" HOT 1
- Error with PHP8.1, Laravel 9.x HOT 2
- laravel 10 compatibility HOT 2
- Update to Laravel 10 HOT 1
- Integrate with Pennant feature flags HOT 1
- [OomBootstrapper] BindingResolutionException: Target class [bugsnag] does not exist. HOT 3
- Ability to cancel error notifications before they are sent to Bugsnag HOT 1
- How to set app version automatically? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bugsnag-laravel.