diff --git a/circonus/circonus.go b/circonus/circonus.go index eb41b99..c0c80c2 100644 --- a/circonus/circonus.go +++ b/circonus/circonus.go @@ -9,6 +9,9 @@ import ( cgm "github.com/circonus-labs/circonus-gometrics" ) +// This ensures *CirconusSink implements the MetricSink interface. +var _ metrics.MetricSink = (*CirconusSink)(nil) + // CirconusSink provides an interface to forward metrics to Circonus with // automatic check creation and metric management type CirconusSink struct { diff --git a/datadog/dogstatsd.go b/datadog/dogstatsd.go index fe021d0..f033ad9 100644 --- a/datadog/dogstatsd.go +++ b/datadog/dogstatsd.go @@ -8,6 +8,9 @@ import ( "github.com/armon/go-metrics" ) +// This ensures *DogStatsdSink implements the MetricSink interface. +var _ metrics.MetricSink = (*DogStatsdSink)(nil) + // DogStatsdSink provides a MetricSink that can be used // with a dogstatsd server. It utilizes the Dogstatsd client at github.com/DataDog/datadog-go/statsd type DogStatsdSink struct { diff --git a/inmem.go b/inmem.go index 4e2d6a7..ee2f136 100644 --- a/inmem.go +++ b/inmem.go @@ -10,6 +10,9 @@ import ( "time" ) +// This ensures *InmemSink implements the MetricSink interface. +var _ MetricSink = (*InmemSink)(nil) + // InmemSink provides a MetricSink that does in-memory aggregation // without sending metrics over a network. It can be embedded within // an application to provide profiling information. diff --git a/prometheus/prometheus.go b/prometheus/prometheus.go index a5b27d6..3e5d438 100644 --- a/prometheus/prometheus.go +++ b/prometheus/prometheus.go @@ -21,6 +21,9 @@ var ( } ) +// This ensures *PrometheusSink implements the MetricSink interface. +var _ metrics.MetricSink = (*PrometheusSink)(nil) + // PrometheusOpts is used to configure the Prometheus Sink type PrometheusOpts struct { // Expiration is the duration a metric is valid for, after which it will be diff --git a/statsd.go b/statsd.go index 1bfffce..2ab3ae6 100644 --- a/statsd.go +++ b/statsd.go @@ -16,6 +16,9 @@ const ( statsdMaxLen = 1400 ) +// This ensures *StatsdSink implements the MetricSink interface. +var _ MetricSink = (*StatsdSink)(nil) + // StatsdSink provides a MetricSink that can be used // with a statsite or statsd metrics server. It uses // only UDP packets, while StatsiteSink uses TCP. diff --git a/statsite.go b/statsite.go index 6c0d284..91023af 100644 --- a/statsite.go +++ b/statsite.go @@ -17,6 +17,9 @@ const ( flushInterval = 100 * time.Millisecond ) +// This ensures *StatsiteSink implements the MetricSink interface. +var _ MetricSink = (*StatsiteSink)(nil) + // NewStatsiteSinkFromURL creates an StatsiteSink from a URL. It is used // (and tested) from NewMetricSinkFromURL. func NewStatsiteSinkFromURL(u *url.URL) (MetricSink, error) {