datadogclient

package
v0.0.0-...-b5b3775 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultAPIURL = "https://app.datadoghq.com/api/v1"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(
	apiURL string,
	apiKey string,
	prefix string,
	deployment string,
	ip string,
	writeTimeout time.Duration,
	maxPostBytes uint32,
	log *gosteno.Logger,
) *Client

func (*Client) AddMetric

func (c *Client) AddMetric(envelope *events.Envelope)

func (*Client) AlertSlowConsumerError

func (c *Client) AlertSlowConsumerError()

func (*Client) PostMetrics

func (c *Client) PostMetrics() error

type Formatter

type Formatter struct{}

func (Formatter) Format

func (f Formatter) Format(prefix string, maxPostBytes uint32, data map[MetricKey]MetricValue) [][]byte

type Metric

type Metric struct {
	Metric string   `json:"metric"`
	Points []Point  `json:"points"`
	Type   string   `json:"type"`
	Host   string   `json:"host,omitempty"`
	Tags   []string `json:"tags,omitempty"`
}

type MetricKey

type MetricKey struct {
	EventType events.Envelope_EventType
	Name      string
	TagsHash  string
}

type MetricValue

type MetricValue struct {
	Tags   []string
	Points []Point
}

type Payload

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

type Point

type Point struct {
	Timestamp int64
	Value     float64
}

func (Point) MarshalJSON

func (p Point) MarshalJSON() ([]byte, error)

func (*Point) UnmarshalJSON

func (p *Point) UnmarshalJSON(in []byte) error

Jump to

Keyboard shortcuts

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