datadog

package
v1.69.0-cluster Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseStream

func ParseStream(r io.Reader, contentEncoding string, callback func(series []Series) error) error

ParseStream parses DataDog POST request for /api/v1/series from reader and calls callback for the parsed request.

callback shouldn't hold series after returning.

Types

type Point

type Point [2]float64

Point represents a point from DataDog POST request to /api/v1/series

func (*Point) Timestamp

func (pt *Point) Timestamp() int64

Timestamp returns timestamp in milliseconds from the given pt.

func (*Point) Value

func (pt *Point) Value() float64

Value returns value from the given pt.

type Request

type Request struct {
	Series []Series `json:"series"`
}

Request represents DataDog POST request to /api/v1/series

See https://docs.datadoghq.com/api/latest/metrics/#submit-metrics

func (*Request) Unmarshal

func (req *Request) Unmarshal(b []byte) error

Unmarshal unmarshals DataDog /api/v1/series request body from b to req.

See https://docs.datadoghq.com/api/latest/metrics/#submit-metrics

b shouldn't be modified when req is in use.

type Series

type Series struct {
	Host string `json:"host"`

	Metric string   `json:"metric"`
	Points []Point  `json:"points"`
	Tags   []string `json:"tags"`
}

Series represents a series item from DataDog POST request to /api/v1/series

See https://docs.datadoghq.com/api/latest/metrics/#submit-metrics

Jump to

Keyboard shortcuts

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