golang-statsd is a convenience wrapper around datadog-go/statsd functions
import github.com/wistia/golang-statsd
golang-statsd is disabled by default. To enable it do something like the following:
statsd_host := "69.163.225.80"
namespace := "dinos"
env := "prod"
component := "comics"
statsd.Configure(statsd_host, namespace, env, component, myLogger)
component will be added as a tag under the key 'component'
myLogger — pass the logger you've configured and are using in your app
statsd.Disable()
Disabling golang-statsd initializes golang-statsd with a no-op writer; this is useful if you don't want to report metrics in a particular environment.
Use golang-statsd as you would datadog-go/statsd but save yourself the trouble of dealing with error handling.
See https://docs.datadoghq.com/developers/metrics/dogstatsd_metrics_submission/?tab=go