Closed ischedrov closed 2 months ago
The constructor on the client doesn’t automatically read environment variables. There is a default client configured via the environment in from statsd.defaults.env import statsd
, which pulls all of the configuration from the environment, if you don’t mind setting STATSD_HOST="statsd-exporter"
and STATSD_PORT=9125
too
@jsocol thank you! It works
Hi there,
I'm trying to configure statsd client on k8s pod. STATSD_IPV6=1 was configured during pod initialization. The statsd exporter pod placed behind the service in the same namespace and available via service name 'statsd-exporter' on 9125 UDP port. When I'm trying to connect to statsd exporter using the code below:
I received an error: ERROR:main:Error connecting to StatsD over IPv6: [Errno -5] No address associated with hostname
But if I specify parameter
ipv6=True
like thatstatsd_client = StatsClient(host='statsd-exporter', port=9125, ipv6=True)
everything works correctly:INFO:main:Successfully connected to StatsD over IPv6
From my perspective, the environment where I'm testing looks correct. DNS correctly resolves the names and 9125 is available (tested via netcat utility).