Drop Opbeat (#1578)

This commit is contained in:
Wan Liuyang 2018-03-21 19:54:27 +08:00 committed by GitHub
parent f0175aa9be
commit d1198f63b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 0 additions and 62 deletions

View File

@ -68,7 +68,6 @@ Optional Integrations
* Configuration for Celery_
* Integration with MailHog_ for local email testing
* Integration with Sentry_ for error logging
* Integration with Opbeat_ for performance monitoring
.. _Bootstrap: https://github.com/twbs/bootstrap
.. _django-environ: https://github.com/joke2k/django-environ
@ -83,7 +82,6 @@ Optional Integrations
.. _MailHog: https://github.com/mailhog/MailHog
.. _Sentry: https://sentry.io/welcome/
.. _docker-compose: https://github.com/docker/compose
.. _Opbeat: https://opbeat.com/
.. _PythonAnywhere: https://www.pythonanywhere.com/
.. _Caddy: https://caddyserver.com/
.. _LetsEncrypt: https://letsencrypt.org/
@ -164,7 +162,6 @@ Answer the prompts with your own desired options_. For example::
use_celery [n]: y
use_mailhog [n]: n
use_sentry_for_error_reporting [y]: y
use_opbeat [n]: y
use_pycharm [n]: y
windows [n]: n
use_docker [y]: n

View File

@ -36,7 +36,6 @@
"use_celery": "n",
"use_mailhog": "n",
"use_sentry_for_error_reporting": "y",
"use_opbeat": "n",
"use_whitenoise": "y",
"use_heroku": "n",
"use_travisci": "n",

View File

@ -81,9 +81,6 @@ use_mailhog [n]
use_sentry_for_error_reporting [n]
Indicates whether the project should be configured to use Sentry_.
use_opbeat [n]
Indicates whether the project should be configured to use Opbeat_.
use_whitenoise [y]
Indicates whether the project should be configured to use WhiteNoise_.
@ -123,8 +120,6 @@ keep_local_envs_in_vcs [y]
.. _Sentry: https://github.com/getsentry/sentry
.. _Opbeat: https://github.com/opbeat/opbeat_python
.. _WhiteNoise: https://github.com/evansd/whitenoise
.. _Heroku: https://github.com/heroku/heroku-buildpack-python

View File

@ -51,9 +51,6 @@ MAILGUN_API_KEY MAILGUN_ACCESS_KEY n/a
MAILGUN_DOMAIN MAILGUN_SENDER_DOMAIN n/a raises error
NEW_RELIC_APP_NAME NEW_RELIC_APP_NAME n/a raises error
NEW_RELIC_LICENSE_KEY NEW_RELIC_LICENSE_KEY n/a raises error
DJANGO_OPBEAT_APP_ID OPBEAT['APP_ID'] n/a raises error
DJANGO_OPBEAT_SECRET_TOKEN OPBEAT['SECRET_TOKEN'] n/a raises error
DJANGO_OPBEAT_ORGANIZATION_ID OPBEAT['ORGANIZATION_ID'] n/a raises error
======================================= =========================== ============================================== ======================================================================
--------------------------

View File

@ -38,10 +38,4 @@ WEB_CONCURRENCY=4
# Sentry
# ------------------------------------------------------------------------------
DJANGO_SENTRY_DSN=
{% endif %}{% if cookiecutter.use_opbeat == 'y' %}
# opbeat
# ------------------------------------------------------------------------------
DJANGO_OPBEAT_ORGANIZATION_ID=
DJANGO_OPBEAT_APP_ID=
DJANGO_OPBEAT_SECRET_TOKEN=
{% endif %}

View File

@ -289,21 +289,6 @@ LOGGING = {
}
}
{%- endif %}
{% if cookiecutter.use_opbeat == 'y' -%}
# opbeat
# ------------------------------------------------------------------------------
# https://opbeat.com/docs/articles/get-started-with-django/#setup
INSTALLED_APPS += ['opbeat.contrib.django'] # noqa F405
# https://opbeat.com/docs/articles/get-started-with-django/#setup
OPBEAT = {
'ORGANIZATION_ID': env('DJANGO_OPBEAT_ORGANIZATION_ID'),
'APP_ID': env('DJANGO_OPBEAT_APP_ID'),
'SECRET_TOKEN': env('DJANGO_OPBEAT_SECRET_TOKEN')
}
# https://opbeat.com/docs/articles/get-started-with-django/#performance-metrics
MIDDLEWARE = ['opbeat.contrib.django.middleware.OpbeatAPMMiddleware'] + MIDDLEWARE
{%- endif %}
# Your stuff...
# ------------------------------------------------------------------------------

View File

@ -12,9 +12,6 @@ Collectfast==0.6.2 # https://github.com/antonagestam/collectfast
{%- if cookiecutter.use_sentry_for_error_reporting == "y" %}
raven==6.6.0 # https://github.com/getsentry/raven-python
{%- endif %}
{%- if cookiecutter.use_opbeat == "y" %}
opbeat==3.6.1 # https://github.com/opbeat/opbeat_python
{%- endif %}
# Django
# ------------------------------------------------------------------------------

View File

@ -46,32 +46,6 @@ class CeleryConfig(AppConfig):
raven_register_signal(raven_client)
{%- endif %}
{% if cookiecutter.use_opbeat == 'y' -%}
if hasattr(settings, 'OPBEAT'):
{% if cookiecutter.use_pycharm == 'y' -%}
# Since opbeat is required in production only,
# imports might (most surely will) be wiped out
# during PyCharm code clean up started
# in other environments.
# @formatter:off
{%- endif %}
from opbeat.contrib.django.models import client as opbeat_client
from opbeat.contrib.django.models import logger as opbeat_logger
from opbeat.contrib.django.models import register_handlers as opbeat_register_handlers
from opbeat.contrib.celery import register_signal as opbeat_register_signal
{% if cookiecutter.use_pycharm == 'y' -%}
# @formatter:on
{%- endif %}
try:
opbeat_register_signal(opbeat_client)
except Exception as e:
opbeat_logger.exception(f'Failed installing celery hook: {e}')
if 'opbeat.contrib.django' in settings.INSTALLED_APPS:
opbeat_register_handlers()
{%- endif %}
@app.task(bind=True)
def debug_task(self):