In local development StatsD is raising `OSError: [WinError 10049] The requested address is not valid in its context` when env variable `STATSD_HOST` is not set. This seems to just be a Windows issue as the error suggests, because I can't get it to happen inside Docker.

This is happening because the default empty string of `settings.STATSD_HOST` gets set as the default host of `statsd.Connection`, and the empty string is not a valid host name in Windows.

https://github.com/PostHog/posthog/blob/1357df0c137e36478be19a1b8739dcdba93d2327/posthog/settings.py#L181
https://github.com/PostHog/posthog/blob/1ec12f26e707489e77077be029ddb79ceeefd944/posthog/celery.py#L35

StatsD sets the default `host` value to `'localhost'`, and restoring this default fixes the errors. I can make a PR tomorrow, but just wanted to check on this:
https://github.com/PostHog/posthog/blob/1357df0c137e36478be19a1b8739dcdba93d2327/posthog/settings.py#L217-L219

I can change it to `if os.environ.get("STATSD_HOST", False):`, but it might make more sense as a separate env variable like `STATSD_ENABLED`. My only concern with that is it's probably a breaking change. Are there any better options?



posthog/celery.py
try:
        g = statsd.Gauge("%s_posthog_celery" % (settings.STATSD_PREFIX,))
        llen = get_client().llen("celery")
        g.send("queue_depth", llen)
    except:
        
        
        return
@app.task(ignore_result=True)
def update_event_partitions():
    with connection.cursor() as cursor:
        cursor.execute(
            "DO $$ BEGIN IF (SELECT exists(select * from pg_proc where proname = 'update_partitions')) THEN PERFORM update_partitions(); END IF; END $$"
        )
@app.task(ignore_result=True)
def clean_stale_partials():
    """Clean stale (meaning older than 7 days) partial social auth sessions."""
    from social_django.models import Partial
    Partial.objects.filter(timestamp__lt=timezone.now() - timezone.timedelta(7)).delete()
@app.task(ignore_result=True)
def status_report():
    from posthog.tasks.status_report import status_report
    status_report()
@app.task(ignore_result=True)
def run_session_recording_retention():
    from posthog.tasks.session_recording_retention import session_recording_retention_scheduler
    session_recording_retention_scheduler()
@app.task(ignore_result=True)
def calculate_event_action_mappings():