Comments (8)
Can you please run composer upgrade -W sentry/sentry-laravel
, so all sub dependencies are updated as well?
from sentry-laravel.
Sorry for late reply, I attempted to revert my composer change and ran command as you suggested. It updated to 4.5.1 and also updated numerous sub dependencies:
- Upgrading symfony/console (v5.4.36 => v5.4.39)
- Upgrading symfony/error-handler (v5.4.38 => v5.4.39)
- Upgrading symfony/event-dispatcher (v5.4.35 => v5.4.39)
- Upgrading symfony/finder (v5.4.35 => v5.4.39)
- Upgrading symfony/http-foundation (v5.4.38 => v5.4.39)
- Upgrading symfony/http-kernel (v5.4.38 => v5.4.39)
- Upgrading symfony/mime (v5.4.38 => v5.4.39)
- Upgrading symfony/options-resolver (v5.4.21 => v5.4.39)
- Upgrading symfony/process (v5.4.36 => v5.4.39)
- Upgrading symfony/routing (v5.4.38 => v5.4.39)
- Upgrading symfony/string (v5.4.36 => v5.4.39)
- Upgrading symfony/translation (v5.4.35 => v5.4.39)
- Upgrading symfony/var-dumper (v5.4.38 => v5.4.39)
However, the error undefined function Sentry\metrics()
is still present.
from sentry-laravel.
What version does composer show
output for sentry/sentry
?
from sentry-laravel.
versions : * 4.7.0
from sentry-laravel.
Can you tell us a bit more about how you setup the SDK? "By the book" https://docs.sentry.io/platforms/php/guides/laravel/ or something custom? Is this error happening on one machine or multiple? Did you dump the composer autoloader, etc. ?
from sentry-laravel.
I wasn't the original developer who created the repo, but I explored to see how things are done and checked your guide. This install is on Laravel 8.83.27 at the moment. Its being composer required like normal. "sentry/sentry-laravel": "*",
So seems like a normal install for the most part.
Most of our laravel installs don't seem to have the config/sentry.php file, but the required .env entries are present. (and this plugin works on all of them so seems like the file must not be required)
I attempted to run php artisan sentry:publish
command and stepped through the prompts, but the undefined metrics() issue will appear when you select 'no' to the javascript sdk step.
I did a composer dump-autoload
and that did not fix it.
After checking the install instructions of different laravel versions and comparing them to what I see in the code, seems like we followed instructions for Laravel 5.x for original install back in 2018. I updated our app/Exceptions/Handler.php
to match Laravel 8.x instructions, but that obviously doesn't have anything to do with the actual error.
The original composer lock versions prior to me attempting to update were (at present the production site runs fine with these versions):
sentry/sentry: 3.12.0
sentry/sentry-laravel: 3.1.2
I can reproduce this issue both on the live production server and our development server in multiple different repos. My next steps will probably be to load an empty Laravel 8.x project and just try to composer install this project and see if it still happens.
from sentry-laravel.
I would advice against "sentry/sentry-laravel": "*"
, it's better to at least lock it to the latest major.
Running a small Laravel 8 sample app hails no such errors for me, the metrics are emitted correctly.
laravel/framework v8.83.27 The Laravel Framework.
sentry/sentry 4.7.0 PHP SDK for Sentry (http://sentry.io)
sentry/sentry-laravel 4.5.1 Laravel SDK for Sentry (https://sentry.io)
Something that is odd:
[2024-04-16 13:10:05] production.ERROR: Call to undefined function Sentry\metrics() {"exception":"[object] (Error(code: 0): Call to undefined function Sentry\\metrics() at /vendor/sentry/sentry-laravel/src/Sentry/Laravel/Integration.php:128)
Line 128
, whereas it should be 125
instead. https://github.com/getsentry/sentry-laravel/blob/master/src/Sentry/Laravel/Integration.php#L125
from sentry-laravel.
Related Issues (20)
- [Cron Monitoring] Whether to consider adding a switch configuration option for Cron monitoring? HOT 2
- Configure Cron Monitoring based on environment HOT 1
- Idle timeout reached HOT 4
- Scheduled task tracing
- Disabling SSL Verify Peer HOT 2
- Add support for Laravel 11.0's Context
- Link to Laravel v10 docs broken HOT 2
- Dependency nyholm/psr7 can be defined like require-dev HOT 1
- Does captureUnhandleException still work for Laravel 11 HOT 1
- SQLSTATE[HY000]: General error: 2006 MySQL server has gone away HOT 6
- Metrics Rate Limits HOT 1
- Wrong stack trace when using in-app middleware HOT 6
- FilesystemAdapterDecorator incompatibility in tests. HOT 2
- Performance monitoring doesn't work in artisan commands
- LighthouseIntegration does not report all the traces to Sentry HOT 4
- Setting http_proxy in config/sentry.php on L10 seems to not work HOT 2
- before_send_check_in breaks serialization when using php artisan optimize HOT 4
- Possible bug if transaction is not sampled? HOT 4
- Sentry delays execution of scheduled commands when offline 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 sentry-laravel.