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

[Bug]: Not seeing errors from Laravel horizon #2171

Closed
markwalet opened this issue Jul 19, 2023 · 4 comments · Fixed by #2176
Closed

[Bug]: Not seeing errors from Laravel horizon #2171

markwalet opened this issue Jul 19, 2023 · 4 comments · Fixed by #2176
Assignees
Labels
🐛 bug Something isn't working

Comments

@markwalet
Copy link
Contributor

Bug report

I've seen some recent updated on the Laravel integration. But I still can't get my horizon process to be properly configured.

I am seeing the jobs that are being run. But I do not see the errors that are being reported there. My jobs are running successfully, but I'm using report(new Exception('')) to mark some stuff as failed internally. Using report() or throw in the fpm instance does seem to work properly.

I'm comparing the behaviour to that of Sentry. If both are exactly the same, we can see all of our important logs in a single tool. Because Laravel has its own exception handler, it may be a good idea to look into that.

I'm pretty sure I can write something that would sent all "Laravel" errors to Datadog, I'm just looking for a way to disable the general php error reporting. If there is anywrong with my configuration that could solve this, that would also be fine ofcourse.

Thanks in advance.

PHP version

8.2.7

Tracer or profiler version

0.90.0

Installed extensions

[PHP Modules]
bcmath
calendar
Core
ctype
curl
date
ddtrace
dom
exif
FFI
fileinfo
filter
ftp
gettext
hash
iconv
igbinary
intl
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcov
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
random
readline
redis
Reflection
session
shmop
SimpleXML
soap
sockets
sodium
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tokenizer
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache
ddtrace

Output of phpinfo()

{
  "date": "2023-07-19T09:40:07Z",
  "os_name": "Linux ~redacted~ SMP Tue Jun 27 21:48:55 UTC 2023 x86_64",
  "os_version": "~redacted~x86_64",
  "version": "0.90.0",
  "lang": "php",
  "lang_version": "8.2.1",
  "env": "~redacted~",
  "enabled": true,
  "service": "~redacted~-worker",
  "enabled_cli": true,
  "agent_url": "http:\/\/localhost:8126",
  "debug": false,
  "analytics_enabled": false,
  "sample_rate": 1,
  "sampling_rules": [],
  "tags": {
    "generated-by": "cloudformation",
    "monitored-by": "datadoghq.eu-commerce",
  },
  "service_mapping": {
    "pdo": "~redacted~-rds",
    "guzzle": "~redacted~-guzzle",
    "curl": "~redacted~-curl",
    "phpredis": "~redacted~-redis",
    "laravel": "~redacted~-laravel"
  },
  "distributed_tracing_enabled": true,
  "priority_sampling_enabled": true,
  "dd_version": "release_2023_07_19_111522",
  "architecture": "x86_64",
  "sapi": "fpm-fcgi",
  "datadog.trace.request_init_hook": "\/opt\/datadog\/dd-library\/0.90.0\/dd-trace-sources\/bridge\/dd_wrap_autoloader.php",
  "open_basedir_configured": false,
  "uri_fragment_regex": null,
  "uri_mapping_incoming": null,
  "uri_mapping_outgoing": null,
  "auto_flush_enabled": false,
  "generate_root_span": true,
  "http_client_split_by_domain": false,
  "measure_compile_time": true,
  "report_hostname_on_root_span": false,
  "traced_internal_functions": null,
  "auto_prepend_file_configured": false,
  "integrations_disabled": "default",
  "enabled_from_env": true,
  "opcache.file_cache": null
}

Upgrading from

No response

@markwalet markwalet added the 🐛 bug Something isn't working label Jul 19, 2023
@PROFeNoM
Copy link
Contributor

Hi Mark 👋 Thanks for pointing this out 😃 I can indeed reproduce the issue when using the report helper function. However, I cannot reproduce it yet when using throw (whether it is manual or not, see screenshots below).

🤔 Is there anything special with your usage of throw? What I'm trying is to basically do a throw(new \Exception("")) in the handle method of my job. Does the following corresponds to your use case?

image image

@PROFeNoM PROFeNoM self-assigned this Jul 19, 2023
@markwalet
Copy link
Contributor Author

Ah you are right, I was incorrectly assuming that this would listen to the job failed event. But that isn't the case. (Those are also not in DataDog)
It's just for the report method, and for failed jobs (like timeout, or too many retries). For api endpoints both the report and throw methods work.

@markwalet
Copy link
Contributor Author

It looks like the pull request is stuck for a few weeks now. Is there any way I can help to speed up the process?

@bwoebi
Copy link
Collaborator

bwoebi commented Aug 14, 2023

It just needed a final review/approval by me and I was mostly busy last week :-)
It will be merged for sure for the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants