Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

wistia/golang-statsd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

golang-statsd

golang-statsd is a convenience wrapper around datadog-go/statsd functions

Getting started

Import golang-statsd:

import github.com/wistia/golang-statsd

Configure 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

Disable golang-statsd:

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.

Using golang-statsd:

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

About

a statsd module for your Go project

Resources

Stars

Watchers

Forks

Contributors 5