-
Type:
Bug
-
Resolution: Gone away
-
Priority:
Unknown
-
None
-
Affects Version/s: None
-
None
-
None
-
None
-
None
-
None
-
None
JackSinner has created Issue #3578: open-telemetry/opentelemetry-auto-laravel report waring in laravel-mongodb. This Jira ticket was filed by GromNaN
Issue Text:
⚬ Laravel-mongodb Version: 5.7.1
⚬ PHP Version: 8.4.11
⚬ Database Driver & Version: mongodb/laravel-mongodb 5.7.1 & ext-mongodb 2.1.1
Description:
When using OpenTelemetry instrumentation with Laravel and MongoDB, executing Eloquent queries triggers a PHP warning/exception in the OpenTelemetry pre-hook for Illuminate\Database\Eloquent\Builder::getModels(), stating that the method is not supported by MongoDB.
Steps to reproduce
1. Install and configure OpenTelemetry PHP auto-instrumentation/extension for Laravel.
2. Use mongodb/laravel-mongodb as the database connection.
3. Perform a standard Eloquent query (e.g., User::all() or User::where('status', 'active')->get()).
4. Check the PHP error logs.
Expected behaviour
Eloquent queries should execute normally and be monitored by OpenTelemetry without throwing unhandled exceptions or warnings regarding method compatibility.
Actual behaviour
A PHP warning is generated in the logs:
PHP Warning: Illuminate\Database\Eloquent\Builder::getModels(): OpenTelemetry: pre hook threw exception, class=Illuminate\Database\Eloquent\Builder function=getModels message=This method is not supported by MongoDB. Try "toMql()" instead. in Unknown on line 0
Logs:
[07-Sep-2026 15:08:42 Asia/Shanghai] PHP Warning: Illuminate\Database\Eloquent\Builder::getModels(): OpenTelemetry: pre hook threw exception, class=Illuminate\Database\Eloquent\Builder function=getModels message=This method is not supported by MongoDB. Try "toMql()" instead. in Unknown on line 0