Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPClient ¶
HTTPClient is the interface used for sending HTTP POST requests to Datadog.
type Point ¶
type Point struct { Metric string `json:"metric"` Points [][]int64 `json:"points"` Type string `json:"type"` Host string `json:"host"` Tags []string `json:"tags"` }
Point represents a single metric.
type PointBuilder ¶
PointBuilder is the interface the DatadogReporter will use to collect metrics to send to Datadog.
type Reporter ¶
type Reporter struct {
// contains filtered or unexported fields
}
Reporter stores configuration for reporting to Datadog.
func NewReporter ¶
func NewReporter( apiKey string, pointBuilder PointBuilder, opts ...ReporterOption, ) *Reporter
NewReporter initializes and returns a new Reporter.
type ReporterOption ¶
type ReporterOption func(*Reporter)
ReporterOption is a func that is used to configure optional settings on a DatadogReporter.
func WithHTTPClient ¶
func WithHTTPClient(c HTTPClient) ReporterOption
WithHTTPClient returns a ReporterOption for configuring the HTTPClient to be used for sending metrics via HTTP to Datadog.
func WithHost ¶
func WithHost(host string) ReporterOption
WithHost is a ReporterOption for configuring the host that is applied to all metrics.
func WithInterval ¶
func WithInterval(d time.Duration) ReporterOption
WithInterval returns a ReporterOption for configuring the interval metrics will be reported to Datadog.