Documentation ¶
Index ¶
- type Counter
- type DatadogOption
- func WithDatadogConfigObject(cfg interface{}) DatadogOption
- func WithDatadogEnabled(enabled bool) DatadogOption
- func WithDatadogLabelValues(lvs []string) DatadogOption
- func WithDatadogLogger(logger log.Logger) DatadogOption
- func WithDatadogNamespace(ns string) DatadogOption
- func WithDatadogServerConnstr(cstr string) DatadogOption
- func WithDatadogServerHost(host string) DatadogOption
- func WithDatadogServerPort(port string) DatadogOption
- func WithDatadogTag(key, value string) DatadogOption
- func WithDatadogTags(tags []string) DatadogOption
- func WithDatadogTickInSeconds(tick int) DatadogOption
- type Gauge
- type Handler
- type Histogram
- type Provider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Counter ¶
type Counter interface{ kit_metrics.Counter }
type DatadogOption ¶
type DatadogOption func(*datadog)
DatadogOption provides way to modify the client object
func WithDatadogConfigObject ¶
func WithDatadogConfigObject(cfg interface{}) DatadogOption
WithDatadogConfigObject sets the properties for datadog using older config object used in past projects. This function is exclusively for backward compatibility. Here is the expected configuration when read in YAML
url: "datadog:8125" namespace: "wingman" tags: - "env:compose" - "ci:true"
the structure which reads the config is defined as
type Config struct { URL string `json:"url" yaml:"url"` Namespace string `json:"namespace" yaml:"namespace"` Tags []string `json:"tags" yaml:"tags"` }
Note: skipErrors is not required anymore
func WithDatadogEnabled ¶
func WithDatadogEnabled(enabled bool) DatadogOption
WithDatadogEnabled toggles the datadog metrics on or off
func WithDatadogLabelValues ¶
func WithDatadogLabelValues(lvs []string) DatadogOption
WithDatadogLabelValues overwrites the existing tags with a new set of tags provided Note, that LabelValues are pair of key and a value past as consecutive elements in the arrray. For instance, if key and value pair are `go-base:true`, pass it as []string{"go-base", "true"} Internally the count for labelvalues is checked and if found odd, it panics
func WithDatadogLogger ¶
func WithDatadogLogger(logger log.Logger) DatadogOption
WithDatadogLogger sets the logger for Datadog Stats
func WithDatadogNamespace ¶
func WithDatadogNamespace(ns string) DatadogOption
WithDatadogNamespace sets the namespace for Datadog Metrics
func WithDatadogServerConnstr ¶
func WithDatadogServerConnstr(cstr string) DatadogOption
WithDatadogServerConnstr sets the server URI for datadog to connect to
func WithDatadogServerHost ¶
func WithDatadogServerHost(host string) DatadogOption
WithDatadogServerHost sets the server URI for datadog to connect to
func WithDatadogServerPort ¶
func WithDatadogServerPort(port string) DatadogOption
WithDatadogServerPort sets the server URI for datadog to connect to
func WithDatadogTag ¶
func WithDatadogTag(key, value string) DatadogOption
WithDatadogTag appends a tag for existing set of tags
func WithDatadogTags ¶
func WithDatadogTags(tags []string) DatadogOption
WithDatadogTags is wrapper on label values where the expected format for tags is traditional `key:value` pair. If token doesn't have a `:` separator it is ignored.
func WithDatadogTickInSeconds ¶
func WithDatadogTickInSeconds(tick int) DatadogOption
WithDatadogTickInSeconds sets the send loop timer in seconds
type Gauge ¶
type Gauge interface{ kit_metrics.Gauge }
type Histogram ¶
type Histogram interface{ kit_metrics.Histogram }
type Provider ¶
type Provider interface { NewCounter(name string, sampleRate float64) Counter NewHistogram(name string, sampleRate float64) Histogram NewGauge(name string) Gauge }
Provider standarizes the metrics interface used by the applications
func NewDatadogMetrics ¶
func NewDatadogMetrics(opts ...DatadogOption) (Provider, error)
NewDatadogMetrics returns metrics which supports Datadog
func NewNoopMetrics ¶
func NewNoopMetrics() Provider