datadog

package
v1.80.0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: Apache-2.0 Imports: 12 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.

func SplitTag added in v1.79.0

func SplitTag(tag string) (string, string)

SplitTag splits DataDog tag into tag name and value.

See https://docs.datadoghq.com/getting_started/tagging/#define-tags

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