getsentry / sentry

Developer-first error tracking and performance monitoring
https://sentry.io
Other
38.52k stars 4.12k forks source link

no events show #1621

Closed yangshiqi closed 9 years ago

yangshiqi commented 9 years ago

my sentry.conf.py is:

# This file is just Python, with a touch of Django which means
# you can inherit and tweak settings to your hearts content.
from sentry.conf.server import *

import os.path

CONF_ROOT = os.path.dirname(__file__)

DATABASES = {
    'default': {
        # You can swap out the engine for MySQL easily by changing this value
        # to ``django.db.backends.mysql`` or to PostgreSQL with
        # ``sentry.db.postgres``

        # If you change this, you'll also need to install the appropriate python
        # package: psycopg2 (Postgres) or mysql-python
        'ENGINE': 'django.db.backends.sqlite3',

        'NAME': os.path.join(CONF_ROOT, 'sentry.db'),
        'USER': 'postgres',
        'PASSWORD': '',
        'HOST': '',
        'PORT': '',
    }
}

# You should not change this setting after your database has been created
# unless you have altered all schemas first
SENTRY_USE_BIG_INTS = True

#########
# Redis #
#########

# Generic Redis configuration used as defaults for various things including:
# Buffers, Quotas, TSDB

SENTRY_REDIS_OPTIONS = {
    'hosts': {
        0: {
            'host': '127.0.0.1',
            'port': 6379,
        }
    }
}

#########
# Cache #
#########

# If you wish to use memcached, install the dependencies and adjust the config
# as shown:
#
#   pip install python-memcached
#
# CACHES = {
#     'default': {
#         'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
#         'LOCATION': ['127.0.0.1:11211'],
#     }
# }
#
# SENTRY_CACHE = 'sentry.cache.django.DjangoCache'

SENTRY_CACHE = 'sentry.cache.redis.RedisCache'

#########
# Queue #
#########

# See http://sentry.readthedocs.org/en/latest/queue/index.html for more
# information on configuring your queue broker and workers. Sentry relies
# on a Python framework called Celery to manage queues.

CELERY_ALWAYS_EAGER = True
BROKER_URL = 'redis://127.0.0.1:6379'

###############
# Rate Limits #
###############

SENTRY_RATELIMITER = 'sentry.ratelimits.redis.RedisRateLimiter'

##################
# Update Buffers #
##################

# Buffers (combined with queueing) act as an intermediate layer between the
# database and the storage API. They will greatly improve efficiency on large
# numbers of the same events being sent to the API in a short amount of time.
# (read: if you send any kind of real data to Sentry, you should enable buffers)

SENTRY_BUFFER = 'sentry.buffer.redis.RedisBuffer'

##########
# Quotas #
##########

# Quotas allow you to rate limit individual projects or the Sentry install as
# a whole.

SENTRY_QUOTAS = 'sentry.quotas.redis.RedisQuota'

########
# TSDB #
########

# The TSDB is used for building charts as well as making things like per-rate
# alerts possible.

SENTRY_TSDB = 'sentry.tsdb.redis.RedisTSDB'

################
# File storage #
################

# Any Django storage backend is compatible with Sentry. For more solutions see
# the django-storages package: https://django-storages.readthedocs.org/en/latest/

SENTRY_FILESTORE = 'django.core.files.storage.FileSystemStorage'
SENTRY_FILESTORE_OPTIONS = {
    'location': '/tmp/sentry-files',
}

##############
# Web Server #
##############

# You MUST configure the absolute URI root for Sentry:
SENTRY_URL_PREFIX = 'http://10.3.12.4:9000'  # No trailing slash!

# If you're using a reverse proxy, you should enable the X-Forwarded-Proto
# header and uncomment the following settings
# SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')

SENTRY_WEB_HOST = '10.3.12.4'
SENTRY_WEB_PORT = 9000
SENTRY_WEB_OPTIONS = {
    # 'workers': 3,  # the number of gunicorn workers
    # 'secure_scheme_headers': {'X-FORWARDED-PROTO': 'https'},
}

###############
# Mail Server #
###############

# For more information check Django's documentation:
#  https://docs.djangoproject.com/en/1.3/topics/email/?from=olddocs#e-mail-backends

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'

EMAIL_HOST = 'localhost'
EMAIL_HOST_PASSWORD = ''
EMAIL_HOST_USER = ''
EMAIL_PORT = 25
EMAIL_USE_TLS = False

# The email address to send on behalf of
SERVER_EMAIL = 'root@localhost'

# If you're using mailgun for inbound mail, set your API key and configure a
# route to forward to /api/hooks/mailgun/inbound/
MAILGUN_API_KEY = ''

########
# etc. #
########

# If this file ever becomes compromised, it's important to regenerate your SECRET_KEY
# Changing this value will result in all current sessions being invalidated
SECRET_KEY = 'BEtp30V+e7v+ExInkaqMgabh3a+ILefRvYN6oD2TZFckaFMXMhzz1g=='

~

test:

[root@web1-spider raven-php]# /Data/apps/php/bin/php ./bin/raven test http://4aca50bcdae04072abc1d0daa15a2d38:9b7c757ff6b14d44a67123d5cf6c02e4a@10.3.12.4:9000/2
Client configuration:
-> servers: [http://10.3.12.4:9000/api/2/store/]
-> project: 2
-> public_key: 4aca50bcdae04072a931d0daa15a2d38
-> secret_key: 9b7c757ff6b14d44a678cd5cf6c02e4a

Sending a test event:
-> event ID: 8939e09d574e4d7580321da23b42e276

Done!

but No Events in the server to display.

server:

(sentry)[root@web2-spider ~]# sentry --config=~/sentry.conf.py start -v 3 --traceback

!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!
!! SENTRY_ADMIN_EMAIL is not configured !!
!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!

Running service: 'http'
[2015-07-22 04:10:39 +0000] [18643] [INFO] Starting gunicorn 19.3.0
[2015-07-22 04:10:39 +0000] [18643] [INFO] Listening at: http://10.3.12.4:9000 (18643)
[2015-07-22 04:10:39 +0000] [18643] [INFO] Using worker: sync
[2015-07-22 04:10:39 +0000] [18652] [INFO] Booting worker with pid: 18652
[2015-07-22 04:10:39 +0000] [18653] [INFO] Booting worker with pid: 18653
[2015-07-22 04:10:39 +0000] [18654] [INFO] Booting worker with pid: 18654

but when i set CELERY_ALWAYS_EAGER = False, the events then show up.

so i guess there is something wrong with the brokers.

yangshiqi commented 9 years ago

i am using the latest version.

yangshiqi commented 9 years ago

ignore. just to start the workers without root, that's ok.