datadog

package
v0.0.0-...-767c769 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metric

type Metric struct {
	Name string
	// contains filtered or unexported fields
}

Metric defines a Datadog-based metric. It implements the SourceMetric interface.

func NewSourceMetric

func NewSourceMetric(name string, config *MetricConfig, minPointAge, counterResetInterval time.Duration) (*Metric, error)

NewSourceMetric creates a new SourceMetric from a metric name and configuration parameters.

func (*Metric) Query

func (m *Metric) Query() string

Query returns the query being imported from Datadog.

func (*Metric) StackdriverData

func (m *Metric) StackdriverData(ctx context.Context, lastPoint time.Time, rec record.MetricRecord) (*metricpb.MetricDescriptor, []*monitoringpb.TimeSeries, error)

StackdriverData issues a Datadog query, returning metric descriptor and time series data. Time series data will include points after the given lastPoint timestamp.

func (*Metric) StackdriverName

func (m *Metric) StackdriverName() string

StackdriverName returns the full Stackdriver metric name (also called "metric type") for this metric.

type MetricConfig

type MetricConfig struct {
	APIKey         string `yaml:"api_key" validate:"nonzero"`
	ApplicationKey string `yaml:"application_key" validate:"nonzero"`
	Query          string `validate:"nonzero"`
	Cumulative     bool
}

MetricConfig defines configuration file parameters for a specific metric imported from Datadog.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL