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
from posthog.tasks.calculate_action import calculate_actions_from_last_calculation
    calculate_actions_from_last_calculation()
@app.task(ignore_result=True)
def calculate_cohort():
    from posthog.tasks.calculate_cohort import calculate_cohorts
    calculate_cohorts()
@app.task(ignore_result=True)
def check_cached_items():
    from posthog.tasks.update_cache import update_cached_items
    update_cached_items()
@app.task(ignore_result=True)
def update_cache_item_task(key: str, cache_type: str, payload: dict) -> None:
    from posthog.tasks.update_cache import update_cache_item
    update_cache_item(key, cache_type, payload)
@app.task(ignore_result=True)
def send_weekly_email_report():
    if settings.EMAIL_REPORTS_ENABLED:
        from posthog.tasks.email import send_weekly_email_reports
        send_weekly_email_reports()
@app.task(ignore_result=True, bind=True)
def debug_task(self):
    print("Request: {0!r}".format(self.request))
@app.task(ignore_result=True)
def calculate_event_property_usage():
    from posthog.tasks.calculate_event_property_usage import calculate_event_property_usage
    calculate_event_property_usage()