Documentation
¶
Overview ¶
Package datadog contains a basic Datadog API client for retrieving metrics back from Datadog.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrHTTP = errors.New("datadog HTTP error")
View Source
var ErrInvalidQuery = errors.New("invalid query")
Functions ¶
This section is empty.
Types ¶
type Client ¶
func (*Client) Query ¶
func (c *Client) Query(ctx context.Context, q QueryParams) (response QueryResponse, err error)
type DataPoint ¶
DataPoint is a tuple of UNIX timestamp, value. It has custom JSON serialisation to allow variadic decoding of the JSON array.
func (*DataPoint) UnmarshalJSON ¶
type QueryParams ¶
type QueryResponse ¶
type QueryResponse struct {
Series []Series
Meta ResponseMetadata
}
type RateLimit ¶
type RateLimit struct {
Limit int64 // X-RateLimit-Limit number of requests allowed in a time period
Period time.Duration // X-RateLimit-Period length of time in seconds for resets (calendar aligned)
Remaining int64 // X-RateLimit-Remaining number of allowed requests left in current time period
Reset time.Duration // X-RateLimit-Reset time in seconds until next reset
}
type ResponseMetadata ¶
type ResponseMetadata struct {
RateLimit RateLimit
}
type Series ¶
type Series struct {
Metric string `json:"metric"`
DisplayName string `json:"display_name"`
Points []DataPoint `json:"pointlist"`
Start UnixTime `json:"start"`
End UnixTime `json:"end"`
Interval int `json:"interval"`
Aggr string `json:"aggr"`
Length int `json:"length"`
Scope string `json:"scope"`
Expression string `json:"expression"`
}
Click to show internal directories.
Click to hide internal directories.