You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During development, should be really helpful to have a dummy statsd client that instead of try to send the metrics to the real statsd, it just print logs with the metrics that you're trying to send.
The text was updated successfully, but these errors were encountered:
That's easily done actually :)
First, set the statsd client to point to a non-existing statsd server. Since it uses udp it won't care if the server exists or not, it will silently fail.
Second, set the logging for statsd to info or higher.
So... something along these lines:
# Settings:STATSD_HOST='127.0.0.1'STATSD_PORT=12345# Set the log levelimportlogginglogger=logging.getLogger('statsd')
logger.setLevel(logging.INFO)
# If you don't have any logging setup yetlogger.addHandler(logging.StreamHandler())
Sorry by my late answer, but I haven't had time to do it before...
Thanks to your response @wolph, I enabled the logs in my Django and it works as expected, but the client continued trying to send metrics to the server (with your config, to 127.0.0.1), so after read the statsd code, I've added this parameter in the #16, hoping to help more users :)
During development, should be really helpful to have a dummy statsd client that instead of try to send the metrics to the real statsd, it just print logs with the metrics that you're trying to send.
The text was updated successfully, but these errors were encountered: