func Set(name Metric, value string, tags []string, rate float64) error {
	if instance != nil {
		return instance.Set(name, value, tags, rate)
	}
	return errors.Errorf("MetricsClient instance is nil, unable to send Set metric.")
}
Set counts the number of unique elements in a group
package metrics
import (
	"fmt"
	"github.com/pkg/errors"
	"github.com/stitchfix/flotilla-os/config"
	"sync"
	"time"
)
type Metric string
const (
	EngineEKSExecute Metric = "engine.eks.execute"
	EngineEKSEnqueue Metric = "engine.eks.enqueue"
	EngineEMRExecute Metric = "engine.emr.execute"
	EngineEMREnqueue Metric = "engine.emr.enqueue"
	EngineEKSTerminate Metric = "engine.eks.terminate"
	EngineEMRTerminate Metric = "engine.emr.terminate"
	EngineEKSRunPodnameChange Metric = "engine.eks.run_podname_changed"
	EngineEKSNodeTriggeredScaledUp Metric = "engine.eks.triggered_scale_up"
	StatusWorkerProcessEKSRun Metric = "status_worker.timing.process_eks_run"
	StatusWorkerAcquireLock Metric = "status_worker.timing.acquire_lock"
	StatusWorkerFetchPodMetrics Metric = "status_worker.timing.fetch_pod_metrics"
	StatusWorkerFetchUpdateStatus Metric = "status_worker.timing.fetch_update_status"
	StatusWorkerLockedRuns Metric = "status_worker.locked_runs"
	StatusWorkerFetchMetrics Metric = "status_worker.fetch_metrics"
	StatusWorkerGetPodList Metric = "status_worker.get_pod_list"
	StatusWorkerGetEvents Metric = "status_worker.get_events"
	StatusWorkerGetJob Metric = "status_worker.get_job"
	EngineUpdateRun Metric = "engine.update_run"
)
type MetricTag string
const (
	StatusSuccess MetricTag = "status:success"
	StatusFailure MetricTag = "status:failure"
)
type Client interface {
	Init(conf config.Config) error
	Decrement(name Metric, tags []string, rate float64) error
	Increment(name Metric, tags []string, rate float64) error
	Histogram(name Metric, value float64, tags []string, rate float64) error
	Distribution(name Metric, value float64, tags []string, rate float64) error
	Set(name Metric, value string, tags []string, rate float64) error
	Event(evt event) error
	Timing(name Metric, value time.Duration, tags []string, rate float64) error
}
type event struct {
	Title string
	Text  string
	Tags  []string
}
var once sync.Once
var instance Client
func InstantiateClient(conf config.Config) error {
	if !conf.IsSet("metrics_client") {
		return fmt.Errorf("`metrics_client` not set in config, unable to instantiate metrics client.")
	}
	var err error = nil
	name := conf.GetString("metrics_client")
	once.Do(func() {
		switch name {
		case "dogstatsd":
			instance = &DatadogStatsdMetricsClient{}
			if err = instance.Init(conf); err != nil {
				err = errors.Errorf("Unable to initialize dogstatsd client.")
				instance = nil
				break
			}
		default:
			err = fmt.Errorf("No Client named [%s] was found", name)
		}
	})
	return err
}
func Decrement(name Metric, tags []string, rate float64) error {
	if instance != nil {
		return instance.Decrement(name, tags, rate)
	}
	return errors.Errorf("MetricsClient instance is nil, unable to send Decrement metric.")
}
func Increment(name Metric, tags []string, rate float64) error {
	if instance != nil {
		return instance.Increment(name, tags, rate)
	}
	return errors.Errorf("MetricsClient instance is nil, unable to send Increment metric.")
}
func Histogram(name Metric, value float64, tags []string, rate float64) error {
	if instance != nil {
		return instance.Histogram(name, value, tags, rate)
	}
	return errors.Errorf("MetricsClient instance is nil, unable to send Histogram metric.")
}
func Distribution(name Metric, value float64, tags []string, rate float64) error {
	if instance != nil {
		return instance.Distribution(name, value, tags, rate)
	}
	return errors.Errorf("MetricsClient instance is nil, unable to send Distribution metric.")
}