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
get_client().set("POSTHOG_HEARTBEAT", int(time.time()))
CLICKHOUSE_TABLES = ["events", "person", "person_distinct_id", "session_recording_events"]
@app.task(ignore_result=True)
def clickhouse_lag():
    if is_ee_enabled() and settings.EE_AVAILABLE:
        from ee.clickhouse.client import sync_execute
        for table in CLICKHOUSE_TABLES:
            QUERY = """select max(_timestamp) observed_ts, now() now_ts, now() - max(_timestamp) as lag from {table};"""
            query = QUERY.format(table=table)
            lag = sync_execute(query)[0][2]
            g = statsd.Gauge("%s_posthog_celery" % (settings.STATSD_PREFIX,))
            g.send("clickhouse_{table}_table_lag_seconds".format(table=table), lag)
    else:
        pass
@app.task(ignore_result=True)
def clickhouse_row_count():
    if is_ee_enabled() and settings.EE_AVAILABLE:
        from ee.clickhouse.client import sync_execute
        for table in CLICKHOUSE_TABLES:
            QUERY = """select count(1) freq from {table};"""
            query = QUERY.format(table=table)
            rows = sync_execute(query)[0][0]
            g = statsd.Gauge("%s_posthog_celery" % (settings.STATSD_PREFIX,))
            g.send("clickhouse_{table}_table_row_count".format(table=table), rows)
    else:
        pass
@app.task(ignore_result=True)
def redis_celery_queue_depth():