Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP error logs were successfully sent to Sentry but on the Sentry Dashboard no logs showed

Tags:

php

sentry

raven

What are the reasons why Sentry Dashboard is not being updated even though errors were successfully sent?

I've tried simulating an error and logging the whole process in Raven library from getting the exception up to sending to sentry. Raven returned a 200 Http code (success) but when I checked it to the Sentry Dashboard the logs were empty.

Our Raven version is 0.9.0

UPDATE:

I've tried the Raven CLI tester as shown here, it successfully send the exception but no logs showed in the Sentry Dashboard.

UPDATE:

Fixed this by reinstalling Sentry and using a new dsn. If there are other solutions that will not require to reinstall and use a new dsn. Feel free to share your answers.

like image 396
jhnferraris Avatar asked Aug 19 '14 05:08

jhnferraris


1 Answers

If you are using SENTRY ON-PREMISE, this can happen if worker processes are not running or your queue are not backed up. The official docs says:

Sentry comes with a built-in queue to process tasks in a more asynchronous fashion. For example when an event comes in instead of writing it to the database immediately, it sends a job to the queue so that the request can be returned right away, and the background workers handle actually saving that data.

And note, its rely on the Celery library for managing workers. So running a worker from CLI might solve this issue :

$ sentry celery worker

Running this as a service is recommended, example configuration with supervisor:

[program:sentry-worker]
directory=/www/sentry/
command=/www/sentry/bin/sentry celery worker -l WARNING
autostart=true
autorestart=true
redirect_stderr=true
killasgroup=true

Sentry supports two primary brokers which may be adjusted depending on your workload:

RabbitMQ  and `Redis`

.

Redis

The default broker is Redis, and will work under most situations. The primary limitation to using Redis is that all pending work must fit in memory.

BROKER_URL = "redis://localhost:6379/0"

If your Redis connection requires a password for authentication, you need to use the following format:

BROKER_URL = "redis://:password@localhost:6379/0"

RabbitMQ

If you run with a high workload, or have concerns about fitting the pending workload in memory, then RabbitMQ is an ideal candidate for backing Sentry’s workers.

BROKER_URL = "amqp://guest:guest@localhost:5672/sentry"
like image 153
2 revs Avatar answered Oct 17 '22 15:10

2 revs