Skip to content

Commit

Permalink
fix: Remove django-statsd (#19255)
Browse files Browse the repository at this point in the history
Remove django-statsd
  • Loading branch information
webjunkie authored Dec 11, 2023
1 parent a0068d0 commit 2f012b4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
8 changes: 0 additions & 8 deletions posthog/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
from posthog.models import Action, Cohort, Dashboard, FeatureFlag, Insight, Team, User
from posthog.rate_limit import DecideRateThrottle
from posthog.settings import SITE_URL, DEBUG
from posthog.settings.statsd import STATSD_HOST
from posthog.user_permissions import UserPermissions
from .auth import PersonalAPIKeyAuthentication
from .utils_cors import cors_response
Expand Down Expand Up @@ -369,13 +368,6 @@ def __init__(self, get_response):
# List of middlewares we want to run, that would've been shortcircuited otherwise
self.CAPTURE_MIDDLEWARE = middlewares

if STATSD_HOST is not None:
# import here to avoid log-spew about failure to connect to statsd,
# as this connection is created on import
from django_statsd.middleware import StatsdMiddlewareTimer

self.CAPTURE_MIDDLEWARE.append(StatsdMiddlewareTimer(get_response=get_response))

def __call__(self, request: HttpRequest):
if request.path in (
"/e",
Expand Down
6 changes: 0 additions & 6 deletions posthog/settings/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from corsheaders.defaults import default_headers

from posthog.settings.base_variables import BASE_DIR, DEBUG, TEST
from posthog.settings.statsd import STATSD_HOST
from posthog.settings.utils import get_from_env, get_list, str_to_bool
from posthog.utils_cors import CORS_ALLOWED_TRACING_HEADERS

Expand Down Expand Up @@ -107,11 +106,6 @@
"posthog.middleware.PostHogTokenCookieMiddleware",
]


if STATSD_HOST is not None:
MIDDLEWARE.insert(0, "django_statsd.middleware.StatsdMiddleware")
MIDDLEWARE.append("django_statsd.middleware.StatsdMiddlewareTimer")

if DEBUG:
# Used on local devenv to reverse-proxy all of /i/* to capture-rs on port 3000
INSTALLED_APPS.append("revproxy")
Expand Down

0 comments on commit 2f012b4

Please sign in to comment.