writer

package
v0.0.0-...-9bd73a0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2018 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(conf *config.AgentConfig) (client *http.Client)

NewClient returns a http.Client configured with the Agent options.

func SetExtraHeaders

func SetExtraHeaders(h http.Header, extras map[string]string)

SetExtraHeaders appends a header map to HTTP headers.

Types

type DatadogEndpoint

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

DatadogEndpoint sends payloads to Datadog API.

func NewDatadogEndpoint

func NewDatadogEndpoint(client *http.Client, url, path, apiKey string) *DatadogEndpoint

NewDatadogEndpoint returns an initialized DatadogEndpoint, from a provided http client and remote endpoint path.

func (*DatadogEndpoint) Write

func (e *DatadogEndpoint) Write(payload []byte, headers map[string]string) error

Write will send the serialized traces payload to the Datadog traces endpoint.

type Endpoint

type Endpoint interface {
	Write(payload []byte, headers map[string]string) error
}

Endpoint is an interface where we send the data from the Agent.

type NullEndpoint

type NullEndpoint struct{}

NullEndpoint is a void endpoint dropping data.

func (*NullEndpoint) Write

func (ne *NullEndpoint) Write(payload []byte, headers map[string]string) error

Write of NullEndpoint just drops the payload and log its size.

type ServiceWriter

type ServiceWriter struct {
	InServices <-chan model.ServicesMetadata
	// contains filtered or unexported fields
}

ServiceWriter ingests service metadata and flush them to the API.

func NewServiceWriter

func NewServiceWriter(conf *config.AgentConfig, InServices <-chan model.ServicesMetadata) *ServiceWriter

NewServiceWriter returns a new writer for services.

func (*ServiceWriter) Flush

func (w *ServiceWriter) Flush()

Flush flushes service metadata, if they changed, to the API

func (*ServiceWriter) Run

func (w *ServiceWriter) Run()

Run runs the main loop of the writer goroutine. If buffers services read from input chan and flushes them when necessary.

func (*ServiceWriter) Start

func (w *ServiceWriter) Start()

Start starts the writer.

func (*ServiceWriter) Stop

func (w *ServiceWriter) Stop()

Stop stops the main Run loop.

type StatsWriter

type StatsWriter struct {
	InStats <-chan []model.StatsBucket
	// contains filtered or unexported fields
}

StatsWriter ingests service metadata and flush them to the API.

func NewStatsWriter

func NewStatsWriter(conf *config.AgentConfig, InStats <-chan []model.StatsBucket) *StatsWriter

NewStatsWriter returns a new writer for services.

func (*StatsWriter) Flush

func (w *StatsWriter) Flush(stats []model.StatsBucket)

Flush flushes received stats

func (*StatsWriter) Run

func (w *StatsWriter) Run()

Run runs the main loop of the writer goroutine. If flushes stats buckets once received from the concentrator.

func (*StatsWriter) Start

func (w *StatsWriter) Start()

Start starts the writer.

func (*StatsWriter) Stop

func (w *StatsWriter) Stop()

Stop stops the main Run loop.

type TraceWriter

type TraceWriter struct {
	InTraces <-chan *model.Trace
	// contains filtered or unexported fields
}

TraceWriter ingests sampled traces and flush them to the API.

func NewTraceWriter

func NewTraceWriter(conf *config.AgentConfig, InTraces <-chan *model.Trace) *TraceWriter

NewTraceWriter returns a new writer for traces.

func (*TraceWriter) Flush

func (w *TraceWriter) Flush()

Flush flushes traces the data in the API

func (*TraceWriter) Run

func (w *TraceWriter) Run()

Run runs the main loop of the writer goroutine. If buffers payloads and services read from input chans and flushes them when necessary.

func (*TraceWriter) Start

func (w *TraceWriter) Start()

Start starts the writer.

func (*TraceWriter) Stop

func (w *TraceWriter) Stop()

Stop stops the main Run loop.

Jump to

Keyboard shortcuts

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